This library is cross-platform and can be compiled and used on Linux, BSD, Opensolaris and Windows (XP and CE). It is heavily based on Ecore main loop.
Eio is a library your application links to. The procedure for this is very simple. You simply have to compile your application with the appropriate compiler flags that the pkg-config
script outputs. For example:
After you understand what Eio is and installed it on your system you should proceed understand the programming interface.
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <Eio.h>
#include <Ecore.h>
{
char *last_slash = strrchr(file, '/');
if (last_slash != NULL && strlen(last_slash) > 1 && last_slash[1] == '.')
}
static void
{
int *number_of_listed_files = (int *)data;
printf("Processing file:%s\n", file);
(*number_of_listed_files)++;
}
static void
{
int *number_of_listed_files = (int *)data;
printf("Number of listed files:%d\n" \
"ls operation is done, quitting.\n", *number_of_listed_files);
}
static void
{
fprintf(stderr, "Something has gone wrong:%s\n", strerror(error));
}
int
main(int argc, char **argv)
{
int number_of_listed_files = 0;
if (argc < 2)
{
fprintf(stderr, "You must pass a path to execute the command.\n");
return -1;
}
eio_file_ls(argv[1], _filter_cb, _main_cb, _done_cb, _error_cb,
&number_of_listed_files);
return 0;
}
EAPI int ecore_shutdown(void)
Shuts down connections, signal handlers sockets etc.
Definition: ecore.c:371
EAPI int ecore_init(void)
Sets up connections, signal handlers, sockets etc.
Definition: ecore.c:230
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:1321
void ecore_main_loop_begin(void)
Runs the application main loop.
Definition: ecore_main.c:1311
#define EINA_TRUE
boolean value TRUE (numerical value 1)
Definition: eina_types.h:539
#define EINA_FALSE
boolean value FALSE (numerical value 0)
Definition: eina_types.h:533
unsigned char Eina_Bool
Type to mimic a boolean.
Definition: eina_types.h:527
#define EINA_UNUSED
Used to indicate that a function parameter is purposely unused.
Definition: eina_types.h:339
EIO_API int eio_init(void)
Initialize eio and all its required submodule.
Definition: eio_main.c:276
EIO_API int eio_shutdown(void)
Shutdown eio and all its submodule if possible.
Definition: eio_main.c:340
EIO_API Eio_File * eio_file_ls(const char *dir, Eio_Filter_Cb filter_cb, Eio_Main_Cb main_cb, Eio_Done_Cb done_cb, Eio_Error_Cb error_cb, const void *data)
List contents of a directory without locking your app.
Definition: eio_file.c:577
struct _Eio_File Eio_File
Generic asynchronous I/O reference.
Definition: Eio.h:73