#include <unistd.h>
#include <Ecore.h>
 
static void
{
   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;
        free(buffer);
     }
}
 
static void
handler(
void *data 
EINA_UNUSED, 
void *buf, 
unsigned int len)
{
   char *str = malloc(sizeof(char) * len + 1);
   memcpy(str, buf, len);
   str[len] = '\0';
   printf("received %u bytes\n", len);
   printf("content: %s\n", (const char *)str);
   free(str);
   if (len && !strncmp(buf, "close", len < 5 ? len : 5))
     {
        printf("close requested\n");
     }
}
 
int
main(void)
{
   pid_t child_pid;
 
 
 
   child_pid = fork();
   if (!child_pid)
     {
        do_lengthy_task(pipe);
     }
   else
     {
     }
 
 
   return 0;
}
 
EAPI int ecore_shutdown(void)
Shuts down connections, signal handlers sockets etc.
Definition: ecore.c:366
EAPI int ecore_init(void)
Sets up connections, signal handlers, sockets etc.
Definition: ecore.c:225
void ecore_main_loop_quit(void)
Quits the main loop once all the events currently on the queue have been processed.
Definition: ecore_main.c:1308
void ecore_main_loop_begin(void)
Runs the application main loop.
Definition: ecore_main.c:1298
struct _Ecore_Pipe Ecore_Pipe
A handle for pipes.
Definition: Ecore_Common.h:2402
Ecore_Pipe * ecore_pipe_add(Ecore_Pipe_Cb handler, const void *data)
Creates two file descriptors (sockets on Windows).
Definition: ecore_pipe.c:93
Eina_Bool ecore_pipe_write(Ecore_Pipe *p, const void *buffer, unsigned int nbytes)
Writes on the file descriptor the data passed as parameter.
Definition: ecore_pipe.c:199
void ecore_pipe_write_close(Ecore_Pipe *p)
Closes the write end of an Ecore_Pipe object created with ecore_pipe_add().
Definition: ecore_pipe.c:176
void * ecore_pipe_del(Ecore_Pipe *p)
Frees an Ecore_Pipe object created with ecore_pipe_add().
Definition: ecore_pipe.c:100
void ecore_pipe_read_close(Ecore_Pipe *p)
Closes the read end of an Ecore_Pipe object created with ecore_pipe_add().
Definition: ecore_pipe.c:108
#define EINA_UNUSED
Used to indicate that a function parameter is purposely unused.
Definition: eina_types.h:339