Shows how to make a simple DNS lookup.
#include <stdio.h>
#include <Ecore.h>
#include <Ecore_Con.h>
static void
_lookup_done_cb(
const char *canonname,
const char *ip,
struct sockaddr *addr,
int addrlen
EINA_UNUSED,
void *data
EINA_UNUSED)
{
printf("canonname = %s\n", canonname);
printf("ip = %s\n", ip);
printf("addr = %p\n", addr);
}
int
main(int argc, const char *argv[])
{
if (argc < 2)
{
printf("need one parameter: <address>\n");
return -1;
}
{
printf("error when trying to start lookup for %s\n", argv[1]);
goto end;
}
end:
return 0;
}
ECORE_CON_API int ecore_con_shutdown(void)
Shuts down the Ecore_Con library.
Definition: ecore_con.c:133
ECORE_CON_API Eina_Bool ecore_con_lookup(const char *name, Ecore_Con_Dns_Cb done_cb, const void *data)
Do an asynchronous DNS lookup.
Definition: ecore_con_legacy.c:2678
ECORE_CON_API int ecore_con_init(void)
Initializes the Ecore_Con library.
Definition: ecore_con.c:68
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_UNUSED
Used to indicate that a function parameter is purposely unused.
Definition: eina_types.h:339