

First thing always is including Eina\+: 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <stdio.h>}}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <\mbox{\hyperlink{Eina_8h}{Eina.h}}>}}

\end{DoxyCodeInclude}


Next we initialize eina and create a string buffer to play with\+: 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keywordtype}{int} main(\textcolor{keywordtype}{int} argc \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}}, \textcolor{keywordtype}{char} **argv \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{struct__Eina__Strbuf}{Eina\_Strbuf}} *buf, *substr;}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__Main__Group_gafee4bfc0e509b6ffed6598edf6f4b3de}{eina\_init}}();}
\DoxyCodeLine{}
\DoxyCodeLine{   buf = \mbox{\hyperlink{group__Eina__String__Buffer__Group_ga6f3c9ce942e61364a10ec7c0ea01cedc}{eina\_strbuf\_new}}();}

\end{DoxyCodeInclude}


Here you can see two different ways of creating a buffer with the same contents. We could create them in simpler ways, but this gives us an opportunity to demonstrate several functions in action\+: 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__String__Buffer__Group_gaad4f562f3a36881f12a4df5154e04b26}{eina\_strbuf\_append\_length}}(buf, \textcolor{stringliteral}{"{}BUFFE"{}}, 5);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__String__Buffer__Group_ga8afef8fb6f9aedcd6a81603bef0c7f86}{eina\_strbuf\_append\_char}}(buf, \textcolor{charliteral}{'R'});}
\DoxyCodeLine{   printf(\textcolor{stringliteral}{"{}\%s\(\backslash\)n"{}}, \mbox{\hyperlink{group__Eina__String__Buffer__Group_ga66c7c19a2b240448fbd2dae6c6161023}{eina\_strbuf\_string\_get}}(buf));}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__String__Buffer__Group_gaa6fbcb0fdebd3e8ec9ba466c2c7b3aaa}{eina\_strbuf\_tolower}}(buf);}
\DoxyCodeLine{   printf(\textcolor{stringliteral}{"{}\%s\(\backslash\)n"{}}, \mbox{\hyperlink{group__Eina__String__Buffer__Group_ga66c7c19a2b240448fbd2dae6c6161023}{eina\_strbuf\_string\_get}}(buf));}
\DoxyCodeLine{}
\DoxyCodeLine{   substr = \mbox{\hyperlink{group__Eina__String__Buffer__Group_ga4c68ed255853465641092387f2bb14c9}{eina\_strbuf\_substr\_get}}(buf, 3, 2);}
\DoxyCodeLine{   printf(\textcolor{stringliteral}{"{}\%s\(\backslash\)n"{}}, \mbox{\hyperlink{group__Eina__String__Buffer__Group_ga66c7c19a2b240448fbd2dae6c6161023}{eina\_strbuf\_string\_get}}(substr));}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__String__Buffer__Group_ga482e9f90bc8e0e17811e825975a2ba85}{eina\_strbuf\_free}}(substr);}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__String__Buffer__Group_ga04719a5613488bbbd17f9eb75933d2c1}{eina\_strbuf\_insert\_escaped}}(buf, \textcolor{stringliteral}{"{}my "{}}, 0);}
\DoxyCodeLine{   printf(\textcolor{stringliteral}{"{}\%s\(\backslash\)n"{}}, \mbox{\hyperlink{group__Eina__String__Buffer__Group_ga66c7c19a2b240448fbd2dae6c6161023}{eina\_strbuf\_string\_get}}(buf));}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__String__Buffer__Group_ga9f3435de2169ee40306c0111fa1a60b6}{eina\_strbuf\_reset}}(buf);}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__String__Buffer__Group_ga408b371f57f35a8f5391c2e85ab28b35}{eina\_strbuf\_append\_escaped}}(buf, \textcolor{stringliteral}{"{}my buffer"{}});}
\DoxyCodeLine{   printf(\textcolor{stringliteral}{"{}\%s\(\backslash\)n"{}}, \mbox{\hyperlink{group__Eina__String__Buffer__Group_ga66c7c19a2b240448fbd2dae6c6161023}{eina\_strbuf\_string\_get}}(buf));}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__String__Buffer__Group_ga9f3435de2169ee40306c0111fa1a60b6}{eina\_strbuf\_reset}}(buf);}

\end{DoxyCodeInclude}


Next we use the printf family of functions to create a formatted string, add, remove and replace some content\+: 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__String__Buffer__Group_ga436897daafadbf56f2e3d7c0d4d21040}{eina\_strbuf\_append\_printf}}(buf, \textcolor{stringliteral}{"{}\%s\%c"{}}, \textcolor{stringliteral}{"{}buffe"{}}, \textcolor{charliteral}{'r'});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__String__Buffer__Group_ga8dca9fa4f4d792e32ab0b3b3542de8ab}{eina\_strbuf\_insert\_printf}}(buf, \textcolor{stringliteral}{"{} \%s: \%d"{}}, 6, \textcolor{stringliteral}{"{}length"{}}, (\textcolor{keywordtype}{int})\mbox{\hyperlink{group__Eina__String__Buffer__Group_gaa6ef2a1cb7f79070508e6bf158caeccc}{eina\_strbuf\_length\_get}}(buf));}
\DoxyCodeLine{   printf(\textcolor{stringliteral}{"{}\%s\(\backslash\)n"{}}, \mbox{\hyperlink{group__Eina__String__Buffer__Group_ga66c7c19a2b240448fbd2dae6c6161023}{eina\_strbuf\_string\_get}}(buf));}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__String__Buffer__Group_gac7ead92f4ce23c16b7a33d40ce3bf5cd}{eina\_strbuf\_remove}}(buf, 0, 7);}
\DoxyCodeLine{   printf(\textcolor{stringliteral}{"{}\%s\(\backslash\)n"{}}, \mbox{\hyperlink{group__Eina__String__Buffer__Group_ga66c7c19a2b240448fbd2dae6c6161023}{eina\_strbuf\_string\_get}}(buf));}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__String__Buffer__Group_gab86cdc70b13b7f6b1c168ed2b563d600}{eina\_strbuf\_replace\_all}}(buf, \textcolor{stringliteral}{"{}length"{}}, \textcolor{stringliteral}{"{}size"{}});}
\DoxyCodeLine{   printf(\textcolor{stringliteral}{"{}\%s\(\backslash\)n"{}}, \mbox{\hyperlink{group__Eina__String__Buffer__Group_ga66c7c19a2b240448fbd2dae6c6161023}{eina\_strbuf\_string\_get}}(buf));}

\end{DoxyCodeInclude}


Once done we free our string buffer, shut down Eina and end the application\+: 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__String__Buffer__Group_ga482e9f90bc8e0e17811e825975a2ba85}{eina\_strbuf\_free}}(buf);}
\DoxyCodeLine{}
\DoxyCodeLine{   buf = \mbox{\hyperlink{group__Eina__String__Buffer__Group_ga5ae85082ac2f6a00621b4a5703850759}{eina\_strbuf\_manage\_read\_only\_new\_length}}(\textcolor{stringliteral}{"{}Example string"{}}, 14);}
\DoxyCodeLine{   printf(\textcolor{stringliteral}{"{}\%s\(\backslash\)n"{}}, \mbox{\hyperlink{group__Eina__String__Buffer__Group_ga66c7c19a2b240448fbd2dae6c6161023}{eina\_strbuf\_string\_get}}(buf));}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__String__Buffer__Group_ga8afef8fb6f9aedcd6a81603bef0c7f86}{eina\_strbuf\_append\_char}}(buf, \textcolor{charliteral}{'.'});}
\DoxyCodeLine{   printf(\textcolor{stringliteral}{"{}\%s\(\backslash\)n"{}}, \mbox{\hyperlink{group__Eina__String__Buffer__Group_ga66c7c19a2b240448fbd2dae6c6161023}{eina\_strbuf\_string\_get}}(buf));}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__String__Buffer__Group_gaad4f562f3a36881f12a4df5154e04b26}{eina\_strbuf\_append\_length}}(buf, \textcolor{stringliteral}{"{}Another string."{}}, 15);}
\DoxyCodeLine{   printf(\textcolor{stringliteral}{"{}\%s\(\backslash\)n"{}}, \mbox{\hyperlink{group__Eina__String__Buffer__Group_ga66c7c19a2b240448fbd2dae6c6161023}{eina\_strbuf\_string\_get}}(buf));}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__String__Buffer__Group_ga482e9f90bc8e0e17811e825975a2ba85}{eina\_strbuf\_free}}(buf);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__Main__Group_ga2c8b4020427108a30c44707af22c99d3}{eina\_shutdown}}();}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\}}

\end{DoxyCodeInclude}
 