struct _Ethumbd_Slave
{
Ecore_Exe *exe;
- Ecore_Event_Handler *data_cb;
- Ecore_Event_Handler *del_cb;
char *bufcmd; // buffer to read commands from slave
int scmd; // size of command to read
int pcmd; // position in the command buffer
double timeout;
Ecore_Timer *timeout_timer;
Ethumbd_Slave slave;
+
+ Ecore_Event_Handler *data_cb;
+ Ecore_Event_Handler *del_cb;
};
struct _Ethumbd_Object_Data
};
static void _ethumb_dbus_generated_signal(Ethumbd *ed, int *id, const char *thumb_path, const char *thumb_key, Eina_Bool success);
-static int _ethumbd_slave_spawn(Ethumbd *ed);
+static Eina_Bool _ethumbd_slave_spawn(Ethumbd_Slave *slave, Ethumbd *ed);
static Eina_Bool
_ethumbd_timeout_cb(void *data)
if (ed->slave.bufcmd)
free(ed->slave.bufcmd);
- return _ethumbd_slave_spawn(ed);
+ return _ethumbd_slave_spawn(&ed->slave, ed);
}
static void
free(ed->queue.list);
}
-static int
-_ethumbd_slave_spawn(Ethumbd *ed)
+static Eina_Bool
+_ethumbd_slave_spawn(Ethumbd_Slave *slave, Ethumbd *ed)
{
- ed->slave.data_cb = ecore_event_handler_add(
- ECORE_EXE_EVENT_DATA, _ethumbd_slave_data_read_cb, ed);
- ed->slave.del_cb = ecore_event_handler_add(
- ECORE_EXE_EVENT_DEL, _ethumbd_slave_del_cb, ed);
-
- ed->slave.bufcmd = NULL;
- ed->slave.scmd = 0;
+ slave->bufcmd = NULL;
+ slave->scmd = 0;
- ed->slave.exe = ecore_exe_pipe_run(
+ slave->exe = ecore_exe_pipe_run(
ETHUMB_LIBEXEC_DIR"/ethumbd_slave",
ECORE_EXE_PIPE_READ | ECORE_EXE_PIPE_WRITE, ed);
- if (!ed->slave.exe)
+ if (!slave->exe)
{
ERR("could not create slave.");
return 0;
}
}
- child = _ethumbd_slave_spawn(&ed);
+ ed.data_cb = ecore_event_handler_add(ECORE_EXE_EVENT_DATA,
+ _ethumbd_slave_data_read_cb, &ed);
+ ed.del_cb = ecore_event_handler_add(ECORE_EXE_EVENT_DEL,
+ _ethumbd_slave_del_cb, &ed);
+
+ child = _ethumbd_slave_spawn(&ed.slave, &ed);
if (!child)
{
exit_value = -6;