\hypertarget{ecore_con_lookup_example_8c-example}{}\doxysection{ecore\+\_\+con\+\_\+lookup\+\_\+example.\+c}
Shows how to make a simple DNS lookup.

Shows how to make a simple DNS lookup. See the complete example description at \mbox{\hyperlink{ecore_con_lookup_example_c}{Ecore\+\_\+\+Con -\/ DNS 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_ga8a20f47372627a03e86a8705a6f8a82d}{ecore\_con\_init}}();}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{group__Ecore__Con__Lib__Group_ga25b58526055fd5bfa3166e6fe182b0fb}{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_ga0e5e01c67f7135e16db0e8f17d087d99}{ecore\_con\_shutdown}}();}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{return}\ 0;}
\DoxyCodeLine{\}}
\DoxyCodeLine{}

\end{DoxyCodeInclude}
 