\hypertarget{group__Eina__Convert__Group}{}\doxysection{Convert}
\label{group__Eina__Convert__Group}\index{Convert@{Convert}}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} int \mbox{\hyperlink{group__Eina__Convert__Group_gafe831a6e2a4017b2fae5c29d60d53586}{eina\+\_\+convert\+\_\+itoa}} (int n, char $\ast$s) \mbox{\hyperlink{group__Eina__Types__Group_ga1a066aa3069f7e43279021cc1e378fac}{E\+I\+N\+A\+\_\+\+A\+R\+G\+\_\+\+N\+O\+N\+N\+U\+LL}}(2)
\begin{DoxyCompactList}\small\item\em Converts an integer number to a string in decimal base. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} int \mbox{\hyperlink{group__Eina__Convert__Group_gae539636184d2c4e80c2e29bf26f40be1}{eina\+\_\+convert\+\_\+xtoa}} (unsigned int n, char $\ast$s) \mbox{\hyperlink{group__Eina__Types__Group_ga1a066aa3069f7e43279021cc1e378fac}{E\+I\+N\+A\+\_\+\+A\+R\+G\+\_\+\+N\+O\+N\+N\+U\+LL}}(2)
\begin{DoxyCompactList}\small\item\em Converts an integer number to a string in hexadecimal base. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} int \mbox{\hyperlink{group__Eina__Convert__Group_ga033cc5d08cc40bd61943b38273dc5c33}{eina\+\_\+convert\+\_\+dtoa}} (double d, char $\ast$des) \mbox{\hyperlink{group__Eina__Types__Group_ga1a066aa3069f7e43279021cc1e378fac}{E\+I\+N\+A\+\_\+\+A\+R\+G\+\_\+\+N\+O\+N\+N\+U\+LL}}(2)
\begin{DoxyCompactList}\small\item\em Converts a double to a string. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} \mbox{\hyperlink{group__Eina__Convert__Group_gae19e891bfefff785bc42c9ec72bdb224}{eina\+\_\+convert\+\_\+atod}} (const char $\ast$src, int length, long long $\ast$m, long $\ast$e) \mbox{\hyperlink{group__Eina__Types__Group_ga1a066aa3069f7e43279021cc1e378fac}{E\+I\+N\+A\+\_\+\+A\+R\+G\+\_\+\+N\+O\+N\+N\+U\+LL}}(1
\begin{DoxyCompactList}\small\item\em Converts a string to a double. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} \mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} int \mbox{\hyperlink{group__Eina__Convert__Group_gaec03d1cb47203e9b66090b4388e40ff3}{eina\+\_\+convert\+\_\+fptoa}} (\mbox{\hyperlink{group__Eina__Fp__Group_ga5264584bb5c6d81dd71d36f9e4e517f1}{Eina\+\_\+\+F32p32}} fp, char $\ast$des) \mbox{\hyperlink{group__Eina__Types__Group_ga1a066aa3069f7e43279021cc1e378fac}{E\+I\+N\+A\+\_\+\+A\+R\+G\+\_\+\+N\+O\+N\+N\+U\+LL}}(2)
\begin{DoxyCompactList}\small\item\em Converts a 32.\+32 fixed point number to a string. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} \mbox{\hyperlink{group__Eina__Convert__Group_gad78818286f5d7c3a0dc06eb50f2a133e}{eina\+\_\+convert\+\_\+atofp}} (const char $\ast$src, int length, \mbox{\hyperlink{group__Eina__Fp__Group_ga5264584bb5c6d81dd71d36f9e4e517f1}{Eina\+\_\+\+F32p32}} $\ast$fp) \mbox{\hyperlink{group__Eina__Types__Group_ga1a066aa3069f7e43279021cc1e378fac}{E\+I\+N\+A\+\_\+\+A\+R\+G\+\_\+\+N\+O\+N\+N\+U\+LL}}(1
\begin{DoxyCompactList}\small\item\em Converts a string to a 32.\+32 fixed point number. \end{DoxyCompactList}\item 
\mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} \mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} double \mbox{\hyperlink{group__Eina__Convert__Group_gac23eb7eee5e200a28704e243ae255881}{eina\+\_\+convert\+\_\+strtod\+\_\+c}} (const char $\ast$nptr, char $\ast$$\ast$endptr)
\begin{DoxyCompactList}\small\item\em Converts a string to a floating point number. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{group__Eina__Convert__Group_gabffa0e511b7f490b1b5aef7297970a33}\label{group__Eina__Convert__Group_gabffa0e511b7f490b1b5aef7297970a33}} 
\mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} \mbox{\hyperlink{group__Eina__Error__Group_ga95b3cbb33e987e7d92a81ea785001686}{Eina\+\_\+\+Error}} \mbox{\hyperlink{group__Eina__Convert__Group_gabffa0e511b7f490b1b5aef7297970a33}{E\+I\+N\+A\+\_\+\+E\+R\+R\+O\+R\+\_\+\+C\+O\+N\+V\+E\+R\+T\+\_\+\+P\+\_\+\+N\+O\+T\+\_\+\+F\+O\+U\+ND}}
\begin{DoxyCompactList}\small\item\em Not used, perhaps a placeholder? Defined as 0 in eina\+\_\+convert.\+c. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{group__Eina__Convert__Group_ga8d6d0c014cab017e97c3a383bcf0300c}\label{group__Eina__Convert__Group_ga8d6d0c014cab017e97c3a383bcf0300c}} 
\mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} \mbox{\hyperlink{group__Eina__Error__Group_ga95b3cbb33e987e7d92a81ea785001686}{Eina\+\_\+\+Error}} \mbox{\hyperlink{group__Eina__Convert__Group_ga8d6d0c014cab017e97c3a383bcf0300c}{E\+I\+N\+A\+\_\+\+E\+R\+R\+O\+R\+\_\+\+C\+O\+N\+V\+E\+R\+T\+\_\+0\+X\+\_\+\+N\+O\+T\+\_\+\+F\+O\+U\+ND}}
\begin{DoxyCompactList}\small\item\em Not used, perhaps a placeholder? Defined as 0 in eina\+\_\+convert.\+c. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{group__Eina__Convert__Group_ga9a0ed4d1300fb636797b638124c0cbe6}\label{group__Eina__Convert__Group_ga9a0ed4d1300fb636797b638124c0cbe6}} 
\mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} \mbox{\hyperlink{group__Eina__Error__Group_ga95b3cbb33e987e7d92a81ea785001686}{Eina\+\_\+\+Error}} \mbox{\hyperlink{group__Eina__Convert__Group_ga9a0ed4d1300fb636797b638124c0cbe6}{E\+I\+N\+A\+\_\+\+E\+R\+R\+O\+R\+\_\+\+C\+O\+N\+V\+E\+R\+T\+\_\+\+O\+U\+T\+R\+U\+N\+\_\+\+S\+T\+R\+I\+N\+G\+\_\+\+L\+E\+N\+G\+TH}}
\begin{DoxyCompactList}\small\item\em Not used, perhaps a placeholder? Defined as 0 in eina\+\_\+convert.\+c. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
These functions allow you to convert integer or real numbers to string or conversely.

To use these functions, you have to call \mbox{\hyperlink{group__Eina__Main__Group_gafee4bfc0e509b6ffed6598edf6f4b3de}{eina\+\_\+init()}} first, and \mbox{\hyperlink{group__Eina__Main__Group_ga2c8b4020427108a30c44707af22c99d3}{eina\+\_\+shutdown()}} when eina is not used anymore.\hypertarget{group__Eina__Convert__Group_Eina_Convert_From_Integer_To_String}{}\doxysubsection{Conversion from integer to string}\label{group__Eina__Convert__Group_Eina_Convert_From_Integer_To_String}
To convert an integer to a string in the decimal base, \mbox{\hyperlink{group__Eina__Convert__Group_gafe831a6e2a4017b2fae5c29d60d53586}{eina\+\_\+convert\+\_\+itoa()}} should be used. If the hexadecimal base is wanted, \mbox{\hyperlink{group__Eina__Convert__Group_gae539636184d2c4e80c2e29bf26f40be1}{eina\+\_\+convert\+\_\+xtoa()}} should be used. They all need a buffer sufficiently large to store all the cyphers.

Here is an example of use\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <stdlib.h>}}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <stdio.h>}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <\mbox{\hyperlink{Eina_8h}{Eina.h}}>}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keywordtype}{int} main(\textcolor{keywordtype}{void})}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \textcolor{keywordtype}{char} tmp[128];}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (!\mbox{\hyperlink{group__Eina__Main__Group_gafee4bfc0e509b6ffed6598edf6f4b3de}{eina\_init}}())}
\DoxyCodeLine{   \{}
\DoxyCodeLine{       printf (\textcolor{stringliteral}{"Error during the initialization of eina.\(\backslash\)n"});}
\DoxyCodeLine{       \textcolor{keywordflow}{return} EXIT\_FAILURE;}
\DoxyCodeLine{   \}}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__Convert__Group_gafe831a6e2a4017b2fae5c29d60d53586}{eina\_convert\_itoa}}(45, tmp);}
\DoxyCodeLine{   printf(\textcolor{stringliteral}{"value: \%s\(\backslash\)n"}, tmp);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__Convert__Group_gae539636184d2c4e80c2e29bf26f40be1}{eina\_convert\_xtoa}}(0xA1, tmp);}
\DoxyCodeLine{   printf(\textcolor{stringliteral}{"value: \%s\(\backslash\)n"}, tmp);}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__Main__Group_ga2c8b4020427108a30c44707af22c99d3}{eina\_shutdown}}();}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{return} EXIT\_SUCCESS;}
\DoxyCodeLine{\}}
\end{DoxyCode}


Compile this code with the following command\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{gcc -\/Wall -\/o test\_eina\_convert test\_eina.c `pkg-\/config -\/-\/cflags -\/-\/libs eina`}
\end{DoxyCode}


\begin{DoxyNote}{Note}
The alphabetical cyphers are in lower case.
\end{DoxyNote}
\hypertarget{group__Eina__Convert__Group_Eina_Convert_Double}{}\doxysubsection{Conversion double / string}\label{group__Eina__Convert__Group_Eina_Convert_Double}
To convert a double to a string, \mbox{\hyperlink{group__Eina__Convert__Group_ga033cc5d08cc40bd61943b38273dc5c33}{eina\+\_\+convert\+\_\+dtoa()}} should be used. Like with the integer functions, a buffer must be used. The resulting string has the following format (which is the result obtained with snprintf() and the \%a modifier)\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{[-\/]0xh.hhhhhp[+-\/]e}
\end{DoxyCode}


To convert a string to a double, \mbox{\hyperlink{group__Eina__Convert__Group_gae19e891bfefff785bc42c9ec72bdb224}{eina\+\_\+convert\+\_\+atod()}} should be used. The format of the string must be as above. Then, the double has the following mantissas and exponent\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{mantissa  : [-\/]hhhhhh}
\DoxyCodeLine{exponent : 2\string^([+-\/]e -\/ 4 * n)}
\end{DoxyCode}


with n being number of cyphers after the point in the string format. To obtain the double number from the mantissas and exponent, use ldexp().

Here is an example of use\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <stdlib.h>}}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <stdio.h>}}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <math.h>}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <\mbox{\hyperlink{Eina_8h}{Eina.h}}>}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keywordtype}{int} main(\textcolor{keywordtype}{void})}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \textcolor{keywordtype}{char}      tmp[128];}
\DoxyCodeLine{   \textcolor{keywordtype}{long} \textcolor{keywordtype}{long} \textcolor{keywordtype}{int} m = 0;}
\DoxyCodeLine{   \textcolor{keywordtype}{long} \textcolor{keywordtype}{int}  e = 0;}
\DoxyCodeLine{   \textcolor{keywordtype}{double}    r;}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (!\mbox{\hyperlink{group__Eina__Main__Group_gafee4bfc0e509b6ffed6598edf6f4b3de}{eina\_init}}())}
\DoxyCodeLine{   \{}
\DoxyCodeLine{       printf (\textcolor{stringliteral}{"Error during the initialization of eina.\(\backslash\)n"});}
\DoxyCodeLine{       \textcolor{keywordflow}{return} EXIT\_FAILURE;}
\DoxyCodeLine{   \}}
\DoxyCodeLine{}
\DoxyCodeLine{   printf(\textcolor{stringliteral}{"initial value : 40.56\(\backslash\)n"});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__Convert__Group_ga033cc5d08cc40bd61943b38273dc5c33}{eina\_convert\_dtoa}}(40.56, tmp);}
\DoxyCodeLine{   printf(\textcolor{stringliteral}{"result dtoa   : \%s\(\backslash\)n"}, tmp);}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__Convert__Group_gae19e891bfefff785bc42c9ec72bdb224}{eina\_convert\_atod}}(tmp, 128, \&m, \&e);}
\DoxyCodeLine{   r = ldexp((\textcolor{keywordtype}{double})m, e);}
\DoxyCodeLine{   printf(\textcolor{stringliteral}{"result atod   : \%f\(\backslash\)n"}, r);}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__Main__Group_ga2c8b4020427108a30c44707af22c99d3}{eina\_shutdown}}();}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{return} EXIT\_SUCCESS;}
\DoxyCodeLine{\}}
\end{DoxyCode}


Compile this code with the following command\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{gcc -\/Wall -\/o test\_eina\_convert test\_eina.c `pkg-\/config -\/-\/cflags -\/-\/libs eina` -\/lm}
\end{DoxyCode}
 

\doxysubsection{Function Documentation}
\mbox{\Hypertarget{group__Eina__Convert__Group_gafe831a6e2a4017b2fae5c29d60d53586}\label{group__Eina__Convert__Group_gafe831a6e2a4017b2fae5c29d60d53586}} 
\index{Convert@{Convert}!eina\_convert\_itoa@{eina\_convert\_itoa}}
\index{eina\_convert\_itoa@{eina\_convert\_itoa}!Convert@{Convert}}
\doxysubsubsection{\texorpdfstring{eina\_convert\_itoa()}{eina\_convert\_itoa()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} int eina\+\_\+convert\+\_\+itoa (\begin{DoxyParamCaption}\item[{int}]{n,  }\item[{char $\ast$}]{s }\end{DoxyParamCaption})}



Converts an integer number to a string in decimal base. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em n} & The integer to convert. \\
\hline
\mbox{\texttt{ out}}  & {\em s} & The buffer to store the converted integer. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The length of the string, including the null terminated character.
\end{DoxyReturn}
This function converts {\ttfamily n} to a null terminated string. The converted string is in decimal base. As no check is done, {\ttfamily s} must be a buffer that is sufficiently large to store the integer.

The returned value is the length of the string, including the null terminated character. 

References E\+I\+N\+A\+\_\+\+S\+A\+F\+E\+T\+Y\+\_\+\+O\+N\+\_\+\+N\+U\+L\+L\+\_\+\+R\+E\+T\+U\+R\+N\+\_\+\+V\+AL.



Referenced by eina\+\_\+convert\+\_\+dtoa(), eina\+\_\+convert\+\_\+fptoa(), and eina\+\_\+xattr\+\_\+int\+\_\+set().

\mbox{\Hypertarget{group__Eina__Convert__Group_gae539636184d2c4e80c2e29bf26f40be1}\label{group__Eina__Convert__Group_gae539636184d2c4e80c2e29bf26f40be1}} 
\index{Convert@{Convert}!eina\_convert\_xtoa@{eina\_convert\_xtoa}}
\index{eina\_convert\_xtoa@{eina\_convert\_xtoa}!Convert@{Convert}}
\doxysubsubsection{\texorpdfstring{eina\_convert\_xtoa()}{eina\_convert\_xtoa()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} int eina\+\_\+convert\+\_\+xtoa (\begin{DoxyParamCaption}\item[{unsigned int}]{n,  }\item[{char $\ast$}]{s }\end{DoxyParamCaption})}



Converts an integer number to a string in hexadecimal base. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em n} & The integer to convert. \\
\hline
\mbox{\texttt{ out}}  & {\em s} & The buffer to store the converted integer. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The length of the string, including the null terminated character.
\end{DoxyReturn}
This function converts {\ttfamily n} to a null terminated string. The converted string is in hexadecimal base and the alphabetical cyphers are in lower case. As no check is done, {\ttfamily s} must be a buffer that is sufficiently large to store the integer.

The returned value is the length of the string, including the nul terminated character. 

References E\+I\+N\+A\+\_\+\+S\+A\+F\+E\+T\+Y\+\_\+\+O\+N\+\_\+\+N\+U\+L\+L\+\_\+\+R\+E\+T\+U\+R\+N\+\_\+\+V\+AL.

\mbox{\Hypertarget{group__Eina__Convert__Group_ga033cc5d08cc40bd61943b38273dc5c33}\label{group__Eina__Convert__Group_ga033cc5d08cc40bd61943b38273dc5c33}} 
\index{Convert@{Convert}!eina\_convert\_dtoa@{eina\_convert\_dtoa}}
\index{eina\_convert\_dtoa@{eina\_convert\_dtoa}!Convert@{Convert}}
\doxysubsubsection{\texorpdfstring{eina\_convert\_dtoa()}{eina\_convert\_dtoa()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} int eina\+\_\+convert\+\_\+dtoa (\begin{DoxyParamCaption}\item[{double}]{d,  }\item[{char $\ast$}]{des }\end{DoxyParamCaption})}



Converts a double to a string. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em d} & The double to convert. \\
\hline
\mbox{\texttt{ out}}  & {\em des} & The destination buffer to store the converted double. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
\mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{E\+I\+N\+A\+\_\+\+T\+R\+UE}} on success, \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{E\+I\+N\+A\+\_\+\+F\+A\+L\+SE}} otherwise.
\end{DoxyReturn}
This function converts the double {\ttfamily d} to a string. The string is stored in the buffer pointed by {\ttfamily des} and must be sufficiently large to contain the converted double. The returned string is null terminated and has the following format\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{[-\/]0xh.hhhhhp[+-\/]e}
\end{DoxyCode}


where the h are the hexadecimal cyphers of the mantissas and e the exponent (a decimal number).

The returned value is the length of the string, including the null character. 

References eina\+\_\+convert\+\_\+itoa(), E\+I\+N\+A\+\_\+\+S\+A\+F\+E\+T\+Y\+\_\+\+O\+N\+\_\+\+F\+A\+L\+S\+E\+\_\+\+R\+E\+T\+U\+R\+N\+\_\+\+V\+AL, and E\+I\+N\+A\+\_\+\+S\+A\+F\+E\+T\+Y\+\_\+\+O\+N\+\_\+\+N\+U\+L\+L\+\_\+\+R\+E\+T\+U\+R\+N\+\_\+\+V\+AL.



Referenced by eina\+\_\+xattr\+\_\+double\+\_\+set().

\mbox{\Hypertarget{group__Eina__Convert__Group_gae19e891bfefff785bc42c9ec72bdb224}\label{group__Eina__Convert__Group_gae19e891bfefff785bc42c9ec72bdb224}} 
\index{Convert@{Convert}!eina\_convert\_atod@{eina\_convert\_atod}}
\index{eina\_convert\_atod@{eina\_convert\_atod}!Convert@{Convert}}
\doxysubsubsection{\texorpdfstring{eina\_convert\_atod()}{eina\_convert\_atod()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} eina\+\_\+convert\+\_\+atod (\begin{DoxyParamCaption}\item[{const char $\ast$}]{src,  }\item[{int}]{length,  }\item[{long long $\ast$}]{m,  }\item[{long $\ast$}]{e }\end{DoxyParamCaption})}



Converts a string to a double. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em src} & The string to convert. \\
\hline
\mbox{\texttt{ in}}  & {\em length} & The length of the string. \\
\hline
\mbox{\texttt{ out}}  & {\em m} & The mantissa. \\
\hline
\mbox{\texttt{ out}}  & {\em e} & The exponent. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
\mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{E\+I\+N\+A\+\_\+\+T\+R\+UE}} on success, \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{E\+I\+N\+A\+\_\+\+F\+A\+L\+SE}} otherwise.
\end{DoxyReturn}
This function converts the string {\ttfamily s} of length {\ttfamily length} that represent a double in hexadecimal base to a double. It is used to replace the use of snprintf() with the \%a modifier, which is missing on some platform (like Windows (tm) or Open\+B\+SD).

The string must have the following format\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{[-\/]0xh.hhhhhp[+-\/]e}
\end{DoxyCode}


where the h are the hexadecimal cyphers of the mantissas and e the exponent (a decimal number). If n is the number of cyphers after the point, the returned mantissas and exponents are\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{mantissa  : [-\/]hhhhhh}
\DoxyCodeLine{exponent : 2\string^([+-\/]e -\/ 4 * n)}
\end{DoxyCode}


The mantissas and exponent are stored in the buffers pointed respectively by {\ttfamily m} and {\ttfamily e}.

If the string is invalid \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{E\+I\+N\+A\+\_\+\+F\+A\+L\+SE}} is returned, otherwise \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{E\+I\+N\+A\+\_\+\+T\+R\+UE}} is returned. 

Referenced by eina\+\_\+xattr\+\_\+double\+\_\+get().

\mbox{\Hypertarget{group__Eina__Convert__Group_gaec03d1cb47203e9b66090b4388e40ff3}\label{group__Eina__Convert__Group_gaec03d1cb47203e9b66090b4388e40ff3}} 
\index{Convert@{Convert}!eina\_convert\_fptoa@{eina\_convert\_fptoa}}
\index{eina\_convert\_fptoa@{eina\_convert\_fptoa}!Convert@{Convert}}
\doxysubsubsection{\texorpdfstring{eina\_convert\_fptoa()}{eina\_convert\_fptoa()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} \mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} int eina\+\_\+convert\+\_\+fptoa (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__Eina__Fp__Group_ga5264584bb5c6d81dd71d36f9e4e517f1}{Eina\+\_\+\+F32p32}}}]{fp,  }\item[{char $\ast$}]{des }\end{DoxyParamCaption})}



Converts a 32.\+32 fixed point number to a string. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em fp} & The fixed point number to convert. \\
\hline
\mbox{\texttt{ out}}  & {\em des} & The destination buffer to store the converted fixed point number. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
\mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{E\+I\+N\+A\+\_\+\+T\+R\+UE}} on success, \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{E\+I\+N\+A\+\_\+\+F\+A\+L\+SE}} otherwise.
\end{DoxyReturn}
This function converts the 32.\+32 fixed point number {\ttfamily fp} to a string. The string is stored in the buffer pointed by {\ttfamily des} and must be sufficiently large to contain the converted fixed point number. The returned string is terminated and has the following format\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{[-\/]0xh.hhhhhp[+-\/]e}
\end{DoxyCode}


where the h are the hexadecimal cyphers of the mantissas and e the exponent (a decimal number).

The returned value is the length of the string, including the null character.

\begin{DoxyNote}{Note}
The code is the same than \mbox{\hyperlink{group__Eina__Convert__Group_ga033cc5d08cc40bd61943b38273dc5c33}{eina\+\_\+convert\+\_\+dtoa()}} except that it implements the frexp() function for fixed point numbers and does some optimization. 
\end{DoxyNote}


References eina\+\_\+convert\+\_\+itoa(), E\+I\+N\+A\+\_\+\+F\+A\+L\+SE, and E\+I\+N\+A\+\_\+\+S\+A\+F\+E\+T\+Y\+\_\+\+O\+N\+\_\+\+N\+U\+L\+L\+\_\+\+R\+E\+T\+U\+R\+N\+\_\+\+V\+AL.

\mbox{\Hypertarget{group__Eina__Convert__Group_gad78818286f5d7c3a0dc06eb50f2a133e}\label{group__Eina__Convert__Group_gad78818286f5d7c3a0dc06eb50f2a133e}} 
\index{Convert@{Convert}!eina\_convert\_atofp@{eina\_convert\_atofp}}
\index{eina\_convert\_atofp@{eina\_convert\_atofp}!Convert@{Convert}}
\doxysubsubsection{\texorpdfstring{eina\_convert\_atofp()}{eina\_convert\_atofp()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} eina\+\_\+convert\+\_\+atofp (\begin{DoxyParamCaption}\item[{const char $\ast$}]{src,  }\item[{int}]{length,  }\item[{\mbox{\hyperlink{group__Eina__Fp__Group_ga5264584bb5c6d81dd71d36f9e4e517f1}{Eina\+\_\+\+F32p32}} $\ast$}]{fp }\end{DoxyParamCaption})}



Converts a string to a 32.\+32 fixed point number. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em src} & The string to convert. \\
\hline
\mbox{\texttt{ in}}  & {\em length} & The length of the string. \\
\hline
\mbox{\texttt{ out}}  & {\em fp} & The fixed point number. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
\mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{E\+I\+N\+A\+\_\+\+T\+R\+UE}} on success, \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{E\+I\+N\+A\+\_\+\+F\+A\+L\+SE}} otherwise.
\end{DoxyReturn}
This function converts the string {\ttfamily src} of length {\ttfamily length} that represent a double in hexadecimal base to a 32.\+32 fixed point number stored in {\ttfamily fp}. The function always tries to convert the string with \mbox{\hyperlink{group__Eina__Convert__Group_gae19e891bfefff785bc42c9ec72bdb224}{eina\+\_\+convert\+\_\+atod()}}.

The string must have the following format\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{[-\/]0xh.hhhhhp[+-\/]e}
\end{DoxyCode}


where the h\textquotesingle{}s are the hexadecimal cyphers of the mantissas and e the exponent (a decimal number). If n is the number of cyphers after the point, the returned mantissas and exponents are\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{mantissa  : [-\/]hhhhhh}
\DoxyCodeLine{exponent : 2\string^([+-\/]e -\/ 4 * n)}
\end{DoxyCode}


The mantissas and exponent are stored in the buffers pointed respectively by {\ttfamily m} and {\ttfamily e}.

If the string is invalid, \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{E\+I\+N\+A\+\_\+\+F\+A\+L\+SE}} is returned, otherwise {\ttfamily fp} is computed and \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{E\+I\+N\+A\+\_\+\+T\+R\+UE}} is returned.

\begin{DoxyNote}{Note}
The code uses \mbox{\hyperlink{group__Eina__Convert__Group_gae19e891bfefff785bc42c9ec72bdb224}{eina\+\_\+convert\+\_\+atod()}} and do the correct bit shift to compute the fixed point number. 
\end{DoxyNote}
\mbox{\Hypertarget{group__Eina__Convert__Group_gac23eb7eee5e200a28704e243ae255881}\label{group__Eina__Convert__Group_gac23eb7eee5e200a28704e243ae255881}} 
\index{Convert@{Convert}!eina\_convert\_strtod\_c@{eina\_convert\_strtod\_c}}
\index{eina\_convert\_strtod\_c@{eina\_convert\_strtod\_c}!Convert@{Convert}}
\doxysubsubsection{\texorpdfstring{eina\_convert\_strtod\_c()}{eina\_convert\_strtod\_c()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool}} \mbox{\hyperlink{group__Elua_ga3db3556eec8ef18cb8ddb43816974ac8}{E\+A\+PI}} double eina\+\_\+convert\+\_\+strtod\+\_\+c (\begin{DoxyParamCaption}\item[{const char $\ast$}]{nptr,  }\item[{char $\ast$$\ast$}]{endptr }\end{DoxyParamCaption})}



Converts a string to a floating point number. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em nptr} & a string to convert. It shouldn\textquotesingle{}t be N\+U\+LL. \\
\hline
\mbox{\texttt{ out}}  & {\em endptr} & If {\ttfamily endptr} is not N\+U\+LL, a pointer to the character after the last character used in the conversion is stored in the location referenced by endptr. If {\ttfamily nptr} is N\+U\+LL, this will also be set to N\+U\+LL. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a double type floating point number.
\end{DoxyReturn}
This function returns converted floating point number with locale-\/independency. Actually, it use \char`\"{}\+C\char`\"{} locale for strtod\+\_\+l function internally. If you need strtod without locale-\/dependency, this function can replace strtod. For more information, please refer documents of strtod, strtod\+\_\+l. 

References E\+I\+N\+A\+\_\+\+S\+A\+F\+E\+T\+Y\+\_\+\+O\+N\+\_\+\+N\+U\+L\+L\+\_\+\+R\+E\+T\+U\+R\+N\+\_\+\+V\+AL.

