\hypertarget{ecore_con_lookup_example_8c-example}{}\doxysection{ecore\+\_\+con\+\_\+lookup\+\_\+example.\+c}
Shows how to make a simple D\+NS lookup. See the complete example description at \mbox{\hyperlink{ecore_con_lookup_example_c}{Ecore\+\_\+\+Con -\/ D\+NS lookup}}


\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{\textcolor{comment}{//Compile with:}}
\DoxyCodeLine{\textcolor{comment}{// gcc -\/o ecore\_con\_lookup\_example ecore\_con\_lookup\_example.c `pkg-\/config -\/-\/libs -\/-\/cflags ecore ecore-\/con`}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <stdio.h>}}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <Ecore.h>}}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <Ecore\_Con.h>}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_lookup\_done\_cb(\textcolor{keyword}{const} \textcolor{keywordtype}{char} *canonname, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *ip, \textcolor{keyword}{struct} sockaddr *addr, \textcolor{keywordtype}{int} addrlen \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}}, \textcolor{keywordtype}{void} *data \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{   printf(\textcolor{stringliteral}{"canonname = \%s\(\backslash\)n"}, canonname);}
\DoxyCodeLine{   printf(\textcolor{stringliteral}{"ip = \%s\(\backslash\)n"}, ip);}
\DoxyCodeLine{   printf(\textcolor{stringliteral}{"addr = \%p\(\backslash\)n"}, addr);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Main__Loop__Group_ga95cf8e97dff0716433c2c5474d606a98}{ecore\_main\_loop\_quit}}();}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keywordtype}{int}}
\DoxyCodeLine{main(\textcolor{keywordtype}{int} argc, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *argv[])}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (argc < 2)}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"need one parameter: <address>\(\backslash\)n"});}
\DoxyCodeLine{        \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Con__Lib__Group_gacf5ecf42c516bb9c8b6759721e9559bd}{ecore\_con\_init}}();}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (!\mbox{\hyperlink{group__Ecore__Con__Lib__Group_ga6b5e2dec763b58570cf5ec1e93dac632}{ecore\_con\_lookup}}(argv[1], \_lookup\_done\_cb, NULL))}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"error when trying to start lookup for \%s\(\backslash\)n"}, argv[1]);}
\DoxyCodeLine{        \textcolor{keywordflow}{goto} end;}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Main__Loop__Group_gaf103b9f668bb3e4fed12e52c6180132d}{ecore\_main\_loop\_begin}}();}
\DoxyCodeLine{}
\DoxyCodeLine{end:}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Con__Lib__Group_gaccfd8dd2a1187b71339b5cc39dc83938}{ecore\_con\_shutdown}}();}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\end{DoxyCodeInclude}
 