コード例 #1
0
static void
do_lengthy_task(Ecore_Pipe *pipe)
{
   int i, j;
   char *buffer;
   for (i = 0; i < 20; i++)
     {
        sleep(1);
        buffer = malloc(sizeof(char) * i);
        for (j = 0; j < i; j++)
           buffer[j] = 'a' + j;
        ecore_pipe_write(pipe, buffer, i);
        free(buffer);
     }
   ecore_pipe_write(pipe, "close", 5);
}
コード例 #2
0
static void
_mp_app_inotify_cb(mp_inotify_event event, char *path, void *data)
{
	DEBUG_TRACE("file operation occured...");

	struct appdata *ad = (struct appdata *)data;

	MP_CHECK(path);

	ecore_pipe_write(ad->inotify_pipe, path, strlen(path));
}
コード例 #3
0
static void
handoff(GstElement *object,
        GstBuffer *arg0,
        GstPad *arg1,
        gpointer user_data)
{
   Ecore_Pipe *pipe;

   pipe = (Ecore_Pipe *)user_data;
   printf("handoff : %p\n", arg0);
   gst_buffer_ref(arg0);
   ecore_pipe_write(pipe, &arg0, sizeof(arg0));
}
コード例 #4
0
static void
_ecore_main_loop_thread_safe_call(Ecore_Safe_Call *order)
{
    Eina_Bool count;

    eina_lock_take(&_thread_safety);

    count = _thread_cb ? 0 : 1;
    _thread_cb = eina_list_append(_thread_cb, order);
    if (count) ecore_pipe_write(_thread_call, &wakeup, sizeof (int));

    eina_lock_release(&_thread_safety);
}
コード例 #5
0
ファイル: mediaplayer.c プロジェクト: GeeXboX/enna
static int
event_cb(player_event_t e, void *data)
{
    enna_mediaplayer_event_t event;

    if (e == PLAYER_EVENT_PLAYBACK_FINISHED)
    {
        event = ENNA_MP_EVENT_EOF;
        ecore_pipe_write(mp->pipe, &event, sizeof(event));
    }

    return 0;
}
コード例 #6
0
static void
_mp_add_available_route_changed_cb(sound_route_e route, bool available, void *user_data)
{
	DEBUG_TRACE("route: %d, available: %d", route, available);
	MP_CHECK(gNotiPipe);

	mp_app_pipe_data_s pipe_data;
	memset(&pipe_data, 0, sizeof(mp_app_pipe_data_s));
	pipe_data.type = MP_APP_PIPE_CB_AVAILABLE_ROUTE_CHANGED;
	pipe_data.user_data = user_data;

	ecore_pipe_write(gNotiPipe, &pipe_data, sizeof(mp_app_pipe_data_s));
}
コード例 #7
0
ファイル: RunLoopEfl.cpp プロジェクト: jiezh/h5vcc
void RunLoop::wakeUp()
{
    {
        MutexLocker locker(m_wakeUpEventRequestedLock);
        if (m_wakeUpEventRequested)
            return;
        m_wakeUpEventRequested = true;
    }

    {
        MutexLocker locker(m_pipeLock);
        ecore_pipe_write(m_pipe.get(), wakupEcorePipeMessage, ecorePipeMessageSize);
    }
}
コード例 #8
0
static void
_mp_app_active_device_chaged_cb(sound_device_in_e in, sound_device_out_e out, void *user_data)
{
	DEBUG_TRACE("input=[%d], output=[%d]", in, out);
	MP_CHECK(gNotiPipe);

	mp_app_pipe_data_s pipe_data;
	memset(&pipe_data, 0, sizeof(mp_app_pipe_data_s));
	pipe_data.type = MP_APP_PIPE_CB_ACTIVE_DEVICE_CHANGED;
	pipe_data.out = out;
	pipe_data.user_data = user_data;

	ecore_pipe_write(gNotiPipe, &pipe_data, sizeof(mp_app_pipe_data_s));
}
コード例 #9
0
ファイル: ecore.c プロジェクト: jordemort/ecore
EAPI void
ecore_fork_reset(void)
{
   Eina_List *l, *ln;
   Ecore_Fork_Cb *fcb;
   
   eina_lock_take(&_thread_safety);

   ecore_pipe_del(_thread_call);
   _thread_call = ecore_pipe_add(_thread_callback, NULL);
   /* If there was something in the pipe, trigger a wakeup again */
   if (_thread_cb) ecore_pipe_write(_thread_call, &wakeup, sizeof (int));

   eina_lock_release(&_thread_safety);

   // should this be done withing the eina lock stuff?
   
   fork_cbs_walking++;
   EINA_LIST_FOREACH(fork_cbs, l, fcb)
     {
        fcb->func(fcb->data);
     }
コード例 #10
0
ファイル: ecore_exe_win32.c プロジェクト: Limsik/e17
/* FIXME: manage error mode */
static int
_ecore_exe_win32_pipe_thread_generic_cb(void           *data,
                                        Ecore_Exe_Flags flags)
{
#define BUFSIZE 2048
   char buf[BUFSIZE];
   Ecore_Exe *exe;
   char *current_buf = NULL;
   HANDLE child_pipe;
   Ecore_Pipe *ecore_pipe;
   Ecore_Exe_Event_Data *event;
   DWORD size;
   DWORD current_size = 0;
   BOOL res;

   exe = (Ecore_Exe *)data;

   /* Sort out what sort of handler we are. */
   /* And get any left over data from last time. */
   if ((exe->flags & ECORE_EXE_PIPE_READ) && (flags == ECORE_EXE_PIPE_READ))
     {
        child_pipe = exe->pipe_read.child_pipe;
        ecore_pipe = exe->pipe_read.p;
        flags = ECORE_EXE_PIPE_READ;
     }
   else if ((exe->flags & ECORE_EXE_PIPE_ERROR) && (flags == ECORE_EXE_PIPE_ERROR))
     {
        child_pipe = exe->pipe_error.child_pipe;
        ecore_pipe = exe->pipe_error.p;
        flags = ECORE_EXE_PIPE_ERROR;
     }
   else
     return 0;

   while (1)
     {
        if (!PeekNamedPipe(child_pipe, buf, sizeof(buf), &size, &current_size, NULL))
          continue;
        if (size == 0)
          continue;
        current_buf = (char *)malloc(current_size);
        if (!current_buf)
          continue;
        res = ReadFile(child_pipe, current_buf, current_size, &size, NULL);
        if (!res || (size == 0))
          {
             free(current_buf);
             current_buf = NULL;
             continue;
          }
        if (current_size != size)
          {
             free(current_buf);
             current_buf = NULL;
             continue;
          }
        current_size = size;

        if (flags == ECORE_EXE_PIPE_READ)
          {
             exe->pipe_read.data_buf = current_buf;
             exe->pipe_read.data_size = current_size;
          }
        else
          {
             exe->pipe_error.data_buf = current_buf;
             exe->pipe_error.data_size = current_size;
          }

        event = ecore_exe_event_data_get(exe, flags);
        if (event)
          ecore_pipe_write(ecore_pipe, &event, sizeof(event));

        current_buf = NULL;
        current_size = 0;
     }

   return 1;
}