本文整理汇总了C++中EPRINTF函数的典型用法代码示例。如果您正苦于以下问题:C++ EPRINTF函数的具体用法?C++ EPRINTF怎么用?C++ EPRINTF使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了EPRINTF函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: remoteMouseHandler
static int
remoteMouseHandler(mwlirc_keystroke * event, MWKEY * kbuf,
MWSCANCODE * pscancode)
{
unsigned speed;
unsigned dir;
int len = 0;
if ((sscanf(event->name, "m_%u_%u%n", &speed, &dir, &len) < 2)
|| (len != strlen(event->name))
|| (dir > 15)
|| (speed > 15)) {
EPRINTF("LIRC_Read() - Invalid mouse event '%s'\n",
event->name);
return 0;
}
return LIRC_mouseMovedPolar(speed, dir);
}
开发者ID:joshdekock,项目名称:jim-psp,代码行数:19,代码来源:kbd_lirc.c
示例2: GsSelect
void
GsSelect (GR_TIMEOUT timeout)
{
struct MW_UID_MESSAGE m;
int rc;
/* perform pre-select duties, if any*/
if (scrdev.PreSelect)
scrdev.PreSelect (&scrdev);
/* let's make sure that the type is invalid */
m.type = MV_UID_INVALID;
/* wait up for events */
rc = uid_read_message (&m, timeout);
/* return if timed-out or something went wrong */
if (rc < 0) {
if (errno != ETIMEDOUT)
EPRINTF (" rc= %d, errno=%d\n", rc, errno);
else {
/* timeout handling */
}
return;
}
/* let's pass the event up to Microwindows */
switch (m.type) {
case MV_UID_REL_POS: /* Mouse or Touch Screen event */
case MV_UID_ABS_POS:
m_mou = m;
while (GsCheckMouseEvent ()) continue;
break;
case MV_UID_KBD: /* KBD event */
m_kbd = m;
GsCheckKeyboardEvent ();
break;
case MV_UID_TIMER: /* Microwindows does nothing with these.. */
case MV_UID_INVALID:
default:
break;
}
}
开发者ID:Kvasshtain,项目名称:uos-embedded,代码行数:43,代码来源:srvmain.c
示例3: td_metrics_stop
void
td_metrics_stop()
{
if (!td_metrics.path)
goto out;
empty_folder(td_metrics.path);
if (rmdir(td_metrics.path) == -1){
EPRINTF("failed to delete metrics folder: %s\n", strerror(errno));
goto out;
}
free(td_metrics.path);
td_metrics.path = NULL;
out:
return;
}
开发者ID:andyhhp,项目名称:blktap,代码行数:19,代码来源:tapdisk-metrics.c
示例4: td_metrics_nbd_stop
int
td_metrics_nbd_stop(stats_t *nbd_stats)
{
int err = 0;
if(!nbd_stats->shm.path)
goto end;
err = shm_destroy(&nbd_stats->shm);
if (unlikely(err)) {
err = errno;
EPRINTF("failed to destroy NBD metrics file: %s\n", strerror(err));
}
free(nbd_stats->shm.path);
nbd_stats->shm.path = NULL;
end:
return err;
}
开发者ID:andyhhp,项目名称:blktap,代码行数:19,代码来源:tapdisk-metrics.c
示例5: vbd_stats_destroy
static int
vbd_stats_destroy(td_vbd_t *vbd) {
int err = 0;
ASSERT(vbd);
err = shm_destroy(&vbd->rrd.shm);
if (unlikely(err)) {
EPRINTF("failed to destroy RRD file: %s\n", strerror(err));
goto out;
}
free(vbd->rrd.shm.path);
vbd->rrd.shm.path = NULL;
out:
return -err;
}
开发者ID:philippegabriel,项目名称:blktap,代码行数:19,代码来源:tapdisk-vbd.c
示例6: EPRINTF
// allocate and a Stream and associate it with a suitable device.
//
static Stream *Stream_new(int dir)
{
AudioDeviceID id= 0;
Stream *s= 0;
if (!getDefaultDevice(&id, dir))
return 0; // no device available
if (!(s= (Stream *)calloc(1, sizeof(Stream))))
{
EPRINTF("out of memory");
return 0;
}
s->id= id;
s->direction= dir;
DPRINTF("stream %p[%d] created for device %ld\n", s, dir, id);
return s;
}
开发者ID:mohamedfarag,项目名称:RoarVM,代码行数:21,代码来源:sqUnixSoundMacOSX.c
示例7: while
void
fb_io_device::display_thread (void)
{
int func_ret = 0;
while(1)
{
wait (m_ev_display);
//printf ("display()\n");
/* if DMA in use */
/* retrieve data */
if (m_regs->m_dmaen)
{
uint32_t offset;
uint32_t addr = m_regs->m_buf_addr;
uint8_t *data = m_io_res->mem;
for (offset = 0; offset < m_io_res->mem_size; offset += 4)
{
func_ret = master->cmd_read (addr + offset, data + offset, 4);
if (!func_ret)
break;
}
if (!func_ret)
EPRINTF ("Error in Read\n");
else
DPRINTF ("Transfer complete\n");
}
kill (m_pid, SIGUSR1);
if (m_regs->m_dmaen)
{
m_regs->m_irqstat |= FB_IO_IRQ_DMA;
m_ev_irq_update.notify ();
}
}
}
开发者ID:marcoscunha,项目名称:reverse,代码行数:42,代码来源:framebuffer_device_io.cpp
示例8: EPRINTF
bool Pong::execute()
{
/* Read the pong message and output the count.
*/
if(false == m_ping_subscription->get()) {
EPRINTF("Error retreiving ping data\n");
}
if(m_ping_subscription->was_updated()) {
IPRINTF("Pong gets %u from ping\n",
m_ping_subscription->content.count);
}
/* Increment and publish the pong count.
*/
++m_pong_publication->content.count;
IPRINTF("Pong puts %u\n", m_pong_publication->content.count);
m_pong_publication->put();
return true;
}
开发者ID:dheater,项目名称:libSPRITE-tutorial,代码行数:20,代码来源:Pong.cpp
示例9: PD_Open
static int
PD_Open(MOUSEDEVICE * pmd)
{
/*
* open up the touch-panel device.
* Return the fd if successful, or negative if unsuccessful.
*/
if ((pd_fd = open(DEVICE, O_NONBLOCK)) < 0) {
EPRINTF("Error %d opening touch panel\n", errno);
return -1;
}
/* This is the default transform for this device */
/* We set it here, so that the system will come up normally */
GdSetTransform(&default_transform);
/* This should normally be disabled, but we leave it on for debugging */
/*GdHideCursor(&scrdev);*/
return pd_fd;
}
开发者ID:BadrElh,项目名称:microwindows,代码行数:21,代码来源:mou_ucb1x00.c
示例10: td_metrics_blktap_stop
int
td_metrics_blktap_stop(stats_t *blktap_stats)
{
int err = 0;
if(!blktap_stats->shm.path)
goto end;
err = shm_destroy(&blktap_stats->shm);
if (unlikely(err)) {
err = errno;
EPRINTF("failed to destroy blktap metrics file: %s\n", strerror(err));
}
free(blktap_stats->shm.path);
blktap_stats->shm.path = NULL;
end:
return err;
}
开发者ID:andyhhp,项目名称:blktap,代码行数:21,代码来源:tapdisk-metrics.c
示例11: CameraRendererRGB565GL2
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
JNIEXPORT void JNICALL Java_com_qualcomm_fastcvdemo_utils_FastCVSampleRenderer_render
(
JNIEnv * env,
jobject obj,
jbyteArray img,
jint w,
jint h
)
{
if( state.cameraRenderer == NULL )
{
state.cameraRenderer = new CameraRendererRGB565GL2();
if (state.cameraRenderer)
{
state.cameraRenderer->Init();
}
else
{
EPRINTF( "Unable to get Camera Render object\n" );
}
}
//if camera frame is ready, display that
if( state.cameraRenderer && state.renderBufRGB565 )
{
lockRenderBuffer();
state.cameraRenderer->Render
(
state.renderBufRGB565,
state.renderBufWidth,
state.renderBufHeight
);
unlockRenderBuffer();
//glFlush();
glFinish();
}
}
开发者ID:twrobel3,项目名称:FCamCompPhotog,代码行数:42,代码来源:FastCVSampleRenderer.cpp
示例12: tap_ctl_write_message
int
tap_ctl_write_message(int fd, tapdisk_message_t * message,
struct timeval *timeout)
{
fd_set writefds;
int ret, len, offset;
offset = 0;
len = sizeof(tapdisk_message_t);
DBG("sending '%s' message (uuid = %u)\n",
tapdisk_message_name(message->type), message->cookie);
while (offset < len) {
FD_ZERO(&writefds);
FD_SET(fd, &writefds);
/* we don't bother reinitializing tv. at worst, it will wait a
* bit more time than expected. */
ret = select(fd + 1, NULL, &writefds, NULL, timeout);
if (ret == -1)
break;
else if (FD_ISSET(fd, &writefds)) {
ret = write(fd, message + offset, len - offset);
if (ret <= 0)
break;
offset += ret;
} else
break;
}
if (offset != len) {
EPRINTF("failure writing message\n");
return -EIO;
}
return 0;
}
开发者ID:majieyue,项目名称:blktap3,代码行数:39,代码来源:tap-ctl-ipc.c
示例13: tapdisk_vbd_create
td_vbd_t*
tapdisk_vbd_create(uint16_t uuid)
{
td_vbd_t *vbd;
int i;
vbd = calloc(1, sizeof(td_vbd_t));
if (!vbd) {
EPRINTF("failed to allocate tapdisk state\n");
return NULL;
}
vbd->uuid = uuid;
vbd->minor = -1;
vbd->ring.fd = -1;
/* default blktap ring completion */
vbd->callback = tapdisk_vbd_callback;
vbd->argument = vbd;
#ifdef MEMSHR
memshr_vbd_initialize();
#endif
INIT_LIST_HEAD(&vbd->driver_stack);
INIT_LIST_HEAD(&vbd->images);
INIT_LIST_HEAD(&vbd->new_requests);
INIT_LIST_HEAD(&vbd->pending_requests);
INIT_LIST_HEAD(&vbd->failed_requests);
INIT_LIST_HEAD(&vbd->completed_requests);
INIT_LIST_HEAD(&vbd->next);
gettimeofday(&vbd->ts, NULL);
for (i = 0; i < MAX_REQUESTS; i++)
tapdisk_vbd_initialize_vreq(vbd->request_list + i);
return vbd;
}
开发者ID:CPFL,项目名称:gxen,代码行数:38,代码来源:tapdisk-vbd.c
示例14: if
bool Task::spawn_thread()
{
Scheduler &sched = Scheduler::get_instance();
/* If rategroup_sync is not NULL at this point, then the task has been
* started previously and is already on the scheduler's list.
*/
if(NULL != m_impl->rategroup_sync) {
m_impl->first_pass = true;
}
else if(m_props.period && (this != &sched)) {
m_impl->rategroup_sync = sched.add_task(*this);
if(NULL == m_impl->rategroup_sync) {
return false;
}
}
/* Spawn the thread.
*/
m_thread_syncpoint.lock();
m_thread_syncpoint.condition_cleared();
if(pthread_create(&(m_impl->tid), &(m_impl->attr), run,
reinterpret_cast<void *>(this)) != 0) {
m_thread_syncpoint.unlock();
EPRINTF("%s: Failed to spawn thread\n", m_name);
return false;
}
/* We can't get the mutex back until the thread has released it. This
* makes sure the the thread has completed it's initilization before
* returning and allowing additional threads to be spawned.
*/
m_thread_syncpoint.condition_cleared();
m_thread_syncpoint.wait();
m_thread_syncpoint.unlock();
return true;
}
开发者ID:E-LLP,项目名称:libSPRITE,代码行数:38,代码来源:Task.cpp
示例15: PD_Read
static int PD_Read(MWCOORD *px, MWCOORD *py, MWCOORD *pz, int *pb)
{
struct ts_sample samp;
int ret;
ret = ts_read(ts, &samp, 1);
if (ret <= 0) {
if (errno == EINTR || errno == EAGAIN)
return 0;
EPRINTF("Error reading from touchscreen: %s\n", strerror(errno));
return -1;
}
*px = samp.x;
*py = samp.y;
*pb = (samp.pressure) ? MWBUTTON_L : 0;
*pz = samp.pressure;
if(!*pb)
return 3;
return 2;
}
开发者ID:BadrElh,项目名称:microwindows,代码行数:23,代码来源:mou_tslib.c
示例16: tapdisk_vbd_create
td_vbd_t*
tapdisk_vbd_create(uint16_t uuid)
{
td_vbd_t *vbd;
vbd = calloc(1, sizeof(td_vbd_t));
if (!vbd) {
EPRINTF("failed to allocate tapdisk state\n");
return NULL;
}
vbd->uuid = uuid;
INIT_LIST_HEAD(&vbd->images);
INIT_LIST_HEAD(&vbd->new_requests);
INIT_LIST_HEAD(&vbd->pending_requests);
INIT_LIST_HEAD(&vbd->failed_requests);
INIT_LIST_HEAD(&vbd->completed_requests);
INIT_LIST_HEAD(&vbd->next);
tapdisk_vbd_mark_progress(vbd);
return vbd;
}
开发者ID:Kristoffer,项目名称:blktap,代码行数:23,代码来源:tapdisk-vbd.c
示例17: tap_ctl_connect_xenblkif
int
tap_ctl_connect_xenblkif(const pid_t pid, const domid_t domid, const int devid, int poll_duration,
int poll_idle_threshold,
const grant_ref_t * grefs, const int order, const evtchn_port_t port,
int proto, const char *pool, const int minor)
{
tapdisk_message_t message;
int i, err;
memset(&message, 0, sizeof(message));
message.type = TAPDISK_MESSAGE_XENBLKIF_CONNECT;
message.cookie = minor;
message.u.blkif.domid = domid;
message.u.blkif.devid = devid;
for (i = 0; i < 1 << order; i++)
message.u.blkif.gref[i] = grefs[i];
message.u.blkif.order = order;
message.u.blkif.port = port;
message.u.blkif.proto = proto;
message.u.blkif.poll_duration = poll_duration;
message.u.blkif.poll_idle_threshold = poll_idle_threshold;
if (pool)
strncpy(message.u.blkif.pool, pool, sizeof(message.u.blkif.pool));
else
message.u.blkif.pool[0] = 0;
err = tap_ctl_connect_send_and_receive(pid, &message, NULL);
if (err || message.type == TAPDISK_MESSAGE_ERROR) {
if (!err)
err = -message.u.response.error;
if (err == -EALREADY)
EPRINTF("failed to connect tapdisk[%d] to the ring: %s\n", pid,
strerror(-err));
}
return err;
}
开发者ID:kostaslamda,项目名称:blktap,代码行数:37,代码来源:tap-ctl-xen.c
示例18: test_set_priority
void *thread_sample(void *arg)
{
char buffer[1024];
struct timespec ts;
double period = 300;
size_t size;
int i;
int rc;
test_set_priority(pthread_self(), SCHED_FIFO, 5);
DPRINTF(stderr, "Thread Sampler: started\n");
DPRINTF(stdout, "# COLUMNS %d Time TL TP ", 2 + cpus);
for (i = 0; i < (cpus - 1); i++)
DPRINTF(stdout, "TF%d ", i);
DPRINTF(stdout, "\n");
ts.tv_sec = 0;
ts.tv_nsec = period * 1000 * 1000;
while (!ts_stop) {
size =
snprintf(buffer, 1023, "%f ", seconds_read() - base_time);
for (i = 0; i < cpus + 1; i++)
size +=
snprintf(buffer + size, 1023 - size, "%u ",
tp[i].progress);
DPRINTF(stdout, "%s\n", buffer);
rc = nanosleep(&ts, NULL);
if (rc < 0)
EPRINTF("UNRESOLVED: Thread %s %d: nanosleep returned "
"%d %s", tp->name, tp->index, rc, strerror(rc));
}
return NULL;
}
开发者ID:1587,项目名称:ltp,代码行数:36,代码来源:pitest-5.c
示例19: tap_ctl_pause
int
tap_ctl_pause(const int id, const int minor, struct timeval *timeout)
{
int err;
tapdisk_message_t message;
memset(&message, 0, sizeof(message));
message.type = TAPDISK_MESSAGE_PAUSE;
message.cookie = minor;
err = tap_ctl_connect_send_and_receive(id, &message, timeout);
if (err)
return err;
if (message.type == TAPDISK_MESSAGE_PAUSE_RSP)
err = message.u.response.error;
else {
err = EINVAL;
EPRINTF("got unexpected result '%s' from %d\n",
tapdisk_message_name(message.type), id);
}
return err;
}
开发者ID:amorozov79,项目名称:blktap,代码行数:24,代码来源:tap-ctl-pause.c
示例20: _start
int _start(int argc, const char **argv)
{
int state;
shutdown();
if (RegisterLibraryEntries(&_exp_sio2man) != 0)
return 1;
if (init)
return 1;
init = 1;
sio2_ctrl_set(0x3bc);
cb1 = NULL; cb2 = NULL; cb3 = NULL; cb4 = NULL;
event_flag = create_event_flag();
thid = create_main_thread();
CpuSuspendIntr(&state);
RegisterIntrHandler(IOP_IRQ_SIO2, 1, sio2_intr_handler, &event_flag);
EnableIntr(IOP_IRQ_SIO2);
CpuResumeIntr(state);
dmac_ch_set_dpcr(IOP_DMAC_SIO2in, 3);
dmac_ch_set_dpcr(IOP_DMAC_SIO2out, 3);
dmac_enable(IOP_DMAC_SIO2in);
dmac_enable(IOP_DMAC_SIO2out);
StartThread(thid, NULL);
#ifndef XSIO2MAN
EPRINTF("Logging started.\n");
#endif
return 0;
}
开发者ID:sp193,项目名称:ps2sdk,代码行数:36,代码来源:sio2man.c
注:本文中的EPRINTF函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论