Of course, instead of printf(), eina_log_print() can be used to have beautiful error messages.
#include <stdlib.h>
#include <stdio.h>
#include <eina_main.h>
#include <eina_error.h>
void *data_new()
{
return NULL;
}
int test(int n)
{
if (n < 0)
{
return 0;
}
return 1;
}
int main(void)
{
void *data;
{
printf ("Error during the initialization of eina_error module\n");
return EXIT_FAILURE;
}
data = data_new();
if (!data)
{
if (err)
printf("Error during memory allocation: %s\n",
}
if (!test(0))
{
if (err)
printf("Error during test function: %s\n",
}
if (!test(-1))
{
if (err)
printf("Error during test function: %s\n",
}
return EXIT_SUCCESS;
}