\doxysection{Using dwarf\+\_\+init\+\_\+path() }
\hypertarget{group__exampleinit}{}\label{group__exampleinit}\index{Using dwarf\_init\_path()@{Using dwarf\_init\_path()}}


Example of a libdwarf initialization call.  


Example of a libdwarf initialization call. 

An example calling \doxylink{group__initfunctions_ga8970fc7d21c9bfe1e7b33fe86579dd3d}{dwarf\+\_\+init\+\_\+path()} and dwarf\+\_\+finish() 
\begin{DoxyParams}{Parameters}
{\em path} & Path to an object we wish to open. \\
\hline
{\em groupnumber} & Desired groupnumber. Use DW\+\_\+\+DW\+\_\+\+GROUPNUMBER\+\_\+\+ANY unless you have reason to do otherwise. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Returns the applicable result. DW\+\_\+\+DLV\+\_\+\+OK etc.
\end{DoxyReturn}

\begin{DoxyCode}{0}
\DoxyCodeLine{*/}
\DoxyCodeLine{\textcolor{keywordtype}{int}\ exampleinit(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *path,\ \textcolor{keywordtype}{unsigned}\ groupnumber)}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{char}\ true\_pathbuf[FILENAME\_MAX];}
\DoxyCodeLine{\ \ \ \ \textcolor{keywordtype}{unsigned}\ tpathlen\ =\ FILENAME\_MAX;}
\DoxyCodeLine{\ \ \ \ \doxymbox{\hyperlink{group__allstructs_ga6de1c2929cebfae36804315f7232cb19}{Dwarf\_Handler}}\ errhand\ =\ 0;}
\DoxyCodeLine{\ \ \ \ \doxymbox{\hyperlink{group__basicdatatypes_ga376c1939313af42401fc67bc998fdd2c}{Dwarf\_Ptr}}\ errarg\ =\ 0;}
\DoxyCodeLine{\ \ \ \ \doxymbox{\hyperlink{group__allstructs_ga8d4fac0e48040b6ca91e06ffda09766a}{Dwarf\_Error}}\ error\ =\ 0;}
\DoxyCodeLine{\ \ \ \ \doxymbox{\hyperlink{group__allstructs_gac2ba1e1c1b70a3191506b414195ca807}{Dwarf\_Debug}}\ dbg\ =\ 0;}
\DoxyCodeLine{\ \ \ \ \textcolor{keywordtype}{int}\ res\ =\ 0;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \ res\ =\ \doxymbox{\hyperlink{group__initfunctions_ga8970fc7d21c9bfe1e7b33fe86579dd3d}{dwarf\_init\_path}}(path,true\_pathbuf,}
\DoxyCodeLine{\ \ \ \ \ \ \ \ tpathlen,groupnumber,errhand,}
\DoxyCodeLine{\ \ \ \ \ \ \ \ errarg,\&dbg,\ \&error);}
\DoxyCodeLine{\ \ \ \ \textcolor{keywordflow}{if}\ (res\ ==\ DW\_DLV\_ERROR)\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{comment}{/*\ \ Necessary\ call\ even\ though\ dbg\ is\ null!}}
\DoxyCodeLine{\textcolor{comment}{\ \ \ \ \ \ \ \ \ \ \ \ This\ avoids\ a\ memory\ leak.\ \ }}

\end{DoxyCode}
