本文整理匯總了C++中EPRINTF函數的典型用法代碼示例。如果您正苦於以下問題:C++ EPRINTF函數的具體用法?C++ EPRINTF怎麽用?C++ EPRINTF使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了EPRINTF函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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);
}
示例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;
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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 ();
}
}
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}