\hypertarget{OTF__File_8h}{\section{ompi/contrib/vt/vt/extlib/otf/otflib/\+O\+T\+F\+\_\+\+File.h File Reference}
\label{OTF__File_8h}\index{ompi/contrib/vt/vt/extlib/otf/otflib/\+O\+T\+F\+\_\+\+File.\+h@{ompi/contrib/vt/vt/extlib/otf/otflib/\+O\+T\+F\+\_\+\+File.\+h}}
}


Provides a low-\/level A\+P\+I for accessing files.  


{\ttfamily \#include \char`\"{}O\+T\+F\+\_\+\+File\+Manager.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}O\+T\+F\+\_\+\+Filenames.\+h\char`\"{}}\\*
\subsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
\hypertarget{OTF__File_8h_a5f3a70c1ff48f16c10577ba5c23fd8a3}{typedef enum \hyperlink{OTF__File_8h_a6a6cba7a163cb883c26b907097017c04}{enum\+\_\+\+O\+T\+F\+\_\+\+File\+Mode} {\bfseries O\+T\+F\+\_\+\+File\+Mode}}\label{OTF__File_8h_a5f3a70c1ff48f16c10577ba5c23fd8a3}

\item 
\hypertarget{OTF__File_8h_ab93cbfd640ecae8b723e0dfc76101078}{typedef enum \hyperlink{OTF__File_8h_a5c7d8e46637f2309eba2ed89325ef8c2}{enum\+\_\+\+O\+T\+F\+\_\+\+File\+Status} {\bfseries O\+T\+F\+\_\+\+File\+Status}}\label{OTF__File_8h_ab93cbfd640ecae8b723e0dfc76101078}

\end{DoxyCompactItemize}
\subsection*{Enumerations}
\begin{DoxyCompactItemize}
\item 
\hypertarget{OTF__File_8h_a6a6cba7a163cb883c26b907097017c04}{enum \hyperlink{OTF__File_8h_a6a6cba7a163cb883c26b907097017c04}{enum\+\_\+\+O\+T\+F\+\_\+\+File\+Mode} \{ {\bfseries O\+T\+F\+\_\+\+F\+I\+L\+E\+M\+O\+D\+E\+\_\+\+N\+O\+T\+H\+I\+N\+G} = 0, 
{\bfseries O\+T\+F\+\_\+\+F\+I\+L\+E\+M\+O\+D\+E\+\_\+\+R\+E\+A\+D} = 1, 
{\bfseries O\+T\+F\+\_\+\+F\+I\+L\+E\+M\+O\+D\+E\+\_\+\+W\+R\+I\+T\+E} = 2, 
{\bfseries O\+T\+F\+\_\+\+F\+I\+L\+E\+M\+O\+D\+E\+\_\+\+S\+E\+E\+K} = 3
 \}}\label{OTF__File_8h_a6a6cba7a163cb883c26b907097017c04}

\begin{DoxyCompactList}\small\item\em mode determining what to do with a file \end{DoxyCompactList}\item 
\hypertarget{OTF__File_8h_a5c7d8e46637f2309eba2ed89325ef8c2}{enum \hyperlink{OTF__File_8h_a5c7d8e46637f2309eba2ed89325ef8c2}{enum\+\_\+\+O\+T\+F\+\_\+\+File\+Status} \{ {\bfseries O\+T\+F\+\_\+\+F\+I\+L\+E\+S\+T\+A\+T\+U\+S\+\_\+\+U\+N\+K\+N\+O\+W\+N} = 0, 
{\bfseries O\+T\+F\+\_\+\+F\+I\+L\+E\+S\+T\+A\+T\+U\+S\+\_\+\+A\+C\+T\+I\+V\+E} = 1, 
{\bfseries O\+T\+F\+\_\+\+F\+I\+L\+E\+S\+T\+A\+T\+U\+S\+\_\+\+S\+U\+S\+P\+E\+N\+D\+E\+D} = 2, 
{\bfseries O\+T\+F\+\_\+\+F\+I\+L\+E\+S\+T\+A\+T\+U\+S\+\_\+\+C\+L\+O\+S\+E\+D} = 3
 \}}\label{OTF__File_8h_a5c7d8e46637f2309eba2ed89325ef8c2}

\begin{DoxyCompactList}\small\item\em status of a file \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{OTF__File_8h_a641ebcb2beddb67d60ef266742dd78c2}{void \hyperlink{OTF__File_8h_a641ebcb2beddb67d60ef266742dd78c2}{O\+T\+F\+\_\+\+File\+\_\+init} (\hyperlink{structstruct__OTF__File}{O\+T\+F\+\_\+\+File} $\ast$o)}\label{OTF__File_8h_a641ebcb2beddb67d60ef266742dd78c2}

\begin{DoxyCompactList}\small\item\em initialize a O\+T\+F\+\_\+\+File object \end{DoxyCompactList}\item 
\hypertarget{OTF__File_8h_ae38536bb83b46fd800e46581caf6c434}{void \hyperlink{OTF__File_8h_ae38536bb83b46fd800e46581caf6c434}{O\+T\+F\+\_\+\+File\+\_\+finalize} (\hyperlink{structstruct__OTF__File}{O\+T\+F\+\_\+\+File} $\ast$o)}\label{OTF__File_8h_ae38536bb83b46fd800e46581caf6c434}

\begin{DoxyCompactList}\small\item\em finalize a O\+T\+F\+\_\+\+File object \end{DoxyCompactList}\item 
\hypertarget{OTF__File_8h_a0c0fa61aca0f7c614af24e028ab54dd7}{\hyperlink{structstruct__OTF__File}{O\+T\+F\+\_\+\+File} $\ast$ \hyperlink{OTF__File_8h_a0c0fa61aca0f7c614af24e028ab54dd7}{O\+T\+F\+\_\+\+File\+\_\+open} (const char $\ast$filename, \hyperlink{group__fm_ga621c18447ec33f803cc270a9494b0685}{O\+T\+F\+\_\+\+File\+Manager} $\ast$manager, O\+T\+F\+\_\+\+File\+Mode mode)}\label{OTF__File_8h_a0c0fa61aca0f7c614af24e028ab54dd7}

\begin{DoxyCompactList}\small\item\em open an O\+T\+F\+\_\+\+File \end{DoxyCompactList}\item 
\hyperlink{structstruct__OTF__File}{O\+T\+F\+\_\+\+File} $\ast$ \hyperlink{OTF__File_8h_a8a7db9b2fce1c76fe94d78e1b2b24641}{O\+T\+F\+\_\+\+File\+\_\+open\+\_\+with\+\_\+external\+\_\+buffer} (uint32\+\_\+t len, const char $\ast$buffer, uint8\+\_\+t is\+\_\+compressed, O\+T\+F\+\_\+\+File\+Mode mode)
\begin{DoxyCompactList}\small\item\em open a pseudo O\+T\+F\+\_\+\+File that actually reads from the given memory buffer. \end{DoxyCompactList}\item 
\hypertarget{OTF__File_8h_a918a9f0b1292196dbf3a625b91740ede}{size\+\_\+t \hyperlink{OTF__File_8h_a918a9f0b1292196dbf3a625b91740ede}{O\+T\+F\+\_\+\+File\+\_\+write} (\hyperlink{structstruct__OTF__File}{O\+T\+F\+\_\+\+File} $\ast$file, const void $\ast$ptr, size\+\_\+t size)}\label{OTF__File_8h_a918a9f0b1292196dbf3a625b91740ede}

\begin{DoxyCompactList}\small\item\em O\+T\+F\+\_\+\+File to an O\+T\+F\+\_\+\+File. \end{DoxyCompactList}\item 
\hypertarget{OTF__File_8h_aeec9aa82150f64fda69ec448c6a8d260}{size\+\_\+t \hyperlink{OTF__File_8h_aeec9aa82150f64fda69ec448c6a8d260}{O\+T\+F\+\_\+\+File\+\_\+read} (\hyperlink{structstruct__OTF__File}{O\+T\+F\+\_\+\+File} $\ast$file, void $\ast$ptr, size\+\_\+t size)}\label{OTF__File_8h_aeec9aa82150f64fda69ec448c6a8d260}

\begin{DoxyCompactList}\small\item\em read from an O\+T\+F\+\_\+\+File \end{DoxyCompactList}\item 
\hypertarget{OTF__File_8h_a4baf7ef28f149d63fd5ae044d8e88ff4}{int \hyperlink{OTF__File_8h_a4baf7ef28f149d63fd5ae044d8e88ff4}{O\+T\+F\+\_\+\+File\+\_\+seek} (\hyperlink{structstruct__OTF__File}{O\+T\+F\+\_\+\+File} $\ast$file, uint64\+\_\+t pos)}\label{OTF__File_8h_a4baf7ef28f149d63fd5ae044d8e88ff4}

\begin{DoxyCompactList}\small\item\em seek absolute position in an O\+T\+F\+\_\+\+File \end{DoxyCompactList}\item 
\hypertarget{OTF__File_8h_a8e1fb83c68f63f3c06724268f1fe8920}{uint64\+\_\+t \hyperlink{OTF__File_8h_a8e1fb83c68f63f3c06724268f1fe8920}{O\+T\+F\+\_\+\+File\+\_\+tell} (\hyperlink{structstruct__OTF__File}{O\+T\+F\+\_\+\+File} $\ast$file)}\label{OTF__File_8h_a8e1fb83c68f63f3c06724268f1fe8920}

\begin{DoxyCompactList}\small\item\em get absolut position from an O\+T\+F\+\_\+\+File \end{DoxyCompactList}\item 
\hypertarget{OTF__File_8h_a4b899a08fcd8a9b7d7c9211b90527632}{uint64\+\_\+t \hyperlink{OTF__File_8h_a4b899a08fcd8a9b7d7c9211b90527632}{O\+T\+F\+\_\+\+File\+\_\+size} (\hyperlink{structstruct__OTF__File}{O\+T\+F\+\_\+\+File} $\ast$file)}\label{OTF__File_8h_a4b899a08fcd8a9b7d7c9211b90527632}

\begin{DoxyCompactList}\small\item\em return the file size in bytes \end{DoxyCompactList}\item 
\hypertarget{OTF__File_8h_af585afdc5f5d8ebd121ee6ca0e2b7fc6}{int \hyperlink{OTF__File_8h_af585afdc5f5d8ebd121ee6ca0e2b7fc6}{O\+T\+F\+\_\+\+File\+\_\+close} (\hyperlink{structstruct__OTF__File}{O\+T\+F\+\_\+\+File} $\ast$file)}\label{OTF__File_8h_af585afdc5f5d8ebd121ee6ca0e2b7fc6}

\begin{DoxyCompactList}\small\item\em close O\+T\+F\+\_\+\+File \end{DoxyCompactList}\item 
\hypertarget{OTF__File_8h_a41cee5b20c9a8798a9e67cef8e815bea}{O\+T\+F\+\_\+\+File\+Status \hyperlink{OTF__File_8h_a41cee5b20c9a8798a9e67cef8e815bea}{O\+T\+F\+\_\+\+File\+\_\+status} (\hyperlink{structstruct__OTF__File}{O\+T\+F\+\_\+\+File} $\ast$file)}\label{OTF__File_8h_a41cee5b20c9a8798a9e67cef8e815bea}

\begin{DoxyCompactList}\small\item\em return O\+T\+F\+\_\+\+File status \end{DoxyCompactList}\item 
void \hyperlink{OTF__File_8h_a9ead59f66b929db1764c626b60eb3c1e}{O\+T\+F\+\_\+\+File\+\_\+suspend} (\hyperlink{structstruct__OTF__File}{O\+T\+F\+\_\+\+File} $\ast$file)
\begin{DoxyCompactList}\small\item\em suspend O\+T\+F\+\_\+\+File -\/ internal use only. \end{DoxyCompactList}\item 
int \hyperlink{OTF__File_8h_a2c1258db338744b0234492057f8e0ed5}{O\+T\+F\+\_\+\+File\+\_\+revive} (\hyperlink{structstruct__OTF__File}{O\+T\+F\+\_\+\+File} $\ast$file, O\+T\+F\+\_\+\+File\+Mode mode)
\begin{DoxyCompactList}\small\item\em re-\/open the file when closed or suspended -\/ internal use only. \end{DoxyCompactList}\item 
\hypertarget{OTF__File_8h_a1ce2fcbe1ac8f73413aa9696adf7e8dd}{void {\bfseries O\+T\+F\+\_\+\+File\+\_\+set\+Z\+Buffer\+Size} (\hyperlink{structstruct__OTF__File}{O\+T\+F\+\_\+\+File} $\ast$file, uint32\+\_\+t size)}\label{OTF__File_8h_a1ce2fcbe1ac8f73413aa9696adf7e8dd}

\item 
\hypertarget{OTF__File_8h_a0b02b52f3f58db8115206076fa7f3251}{\hyperlink{structstruct__OTF__File}{O\+T\+F\+\_\+\+File} $\ast$ \hyperlink{OTF__File_8h_a0b02b52f3f58db8115206076fa7f3251}{O\+T\+F\+\_\+\+File\+\_\+open\+\_\+zlevel} (const char $\ast$filename, \hyperlink{group__fm_ga621c18447ec33f803cc270a9494b0685}{O\+T\+F\+\_\+\+File\+Manager} $\ast$manager, O\+T\+F\+\_\+\+File\+Mode mode, O\+T\+F\+\_\+\+File\+Compression compression)}\label{OTF__File_8h_a0b02b52f3f58db8115206076fa7f3251}

\begin{DoxyCompactList}\small\item\em internal use \end{DoxyCompactList}\item 
\hypertarget{OTF__File_8h_a5a521ed6f25ff03cd96b67ee14115621}{size\+\_\+t \hyperlink{OTF__File_8h_a5a521ed6f25ff03cd96b67ee14115621}{O\+T\+F\+\_\+\+File\+\_\+read\+\_\+internal} (\hyperlink{structstruct__OTF__File}{O\+T\+F\+\_\+\+File} $\ast$file, void $\ast$dest, size\+\_\+t length)}\label{OTF__File_8h_a5a521ed6f25ff03cd96b67ee14115621}

\begin{DoxyCompactList}\small\item\em read 'length' bytes from underlying file or from special memory buffer \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Provides a low-\/level A\+P\+I for accessing files. 



\subsection{Function Documentation}
\hypertarget{OTF__File_8h_a8a7db9b2fce1c76fe94d78e1b2b24641}{\index{O\+T\+F\+\_\+\+File.\+h@{O\+T\+F\+\_\+\+File.\+h}!O\+T\+F\+\_\+\+File\+\_\+open\+\_\+with\+\_\+external\+\_\+buffer@{O\+T\+F\+\_\+\+File\+\_\+open\+\_\+with\+\_\+external\+\_\+buffer}}
\index{O\+T\+F\+\_\+\+File\+\_\+open\+\_\+with\+\_\+external\+\_\+buffer@{O\+T\+F\+\_\+\+File\+\_\+open\+\_\+with\+\_\+external\+\_\+buffer}!O\+T\+F\+\_\+\+File.\+h@{O\+T\+F\+\_\+\+File.\+h}}
\subsubsection[{O\+T\+F\+\_\+\+File\+\_\+open\+\_\+with\+\_\+external\+\_\+buffer}]{\setlength{\rightskip}{0pt plus 5cm}{\bf O\+T\+F\+\_\+\+File}$\ast$ O\+T\+F\+\_\+\+File\+\_\+open\+\_\+with\+\_\+external\+\_\+buffer (
\begin{DoxyParamCaption}
\item[{uint32\+\_\+t}]{len, }
\item[{const char $\ast$}]{buffer, }
\item[{uint8\+\_\+t}]{is\+\_\+compressed, }
\item[{O\+T\+F\+\_\+\+File\+Mode}]{mode}
\end{DoxyParamCaption}
)}}\label{OTF__File_8h_a8a7db9b2fce1c76fe94d78e1b2b24641}


open a pseudo O\+T\+F\+\_\+\+File that actually reads from the given memory buffer. 

The buffer is not copied, you need to manage it yourself! Don't touch it during access operations. 

References struct\+\_\+\+O\+T\+F\+\_\+\+File\+::externalbuffer, struct\+\_\+\+O\+T\+F\+\_\+\+File\+::externallen, struct\+\_\+\+O\+T\+F\+\_\+\+File\+::externalpos, and O\+T\+F\+\_\+\+File\+\_\+init().



Referenced by O\+T\+F\+\_\+\+R\+Buffer\+\_\+open\+\_\+with\+\_\+external\+\_\+buffer().

\hypertarget{OTF__File_8h_a2c1258db338744b0234492057f8e0ed5}{\index{O\+T\+F\+\_\+\+File.\+h@{O\+T\+F\+\_\+\+File.\+h}!O\+T\+F\+\_\+\+File\+\_\+revive@{O\+T\+F\+\_\+\+File\+\_\+revive}}
\index{O\+T\+F\+\_\+\+File\+\_\+revive@{O\+T\+F\+\_\+\+File\+\_\+revive}!O\+T\+F\+\_\+\+File.\+h@{O\+T\+F\+\_\+\+File.\+h}}
\subsubsection[{O\+T\+F\+\_\+\+File\+\_\+revive}]{\setlength{\rightskip}{0pt plus 5cm}int O\+T\+F\+\_\+\+File\+\_\+revive (
\begin{DoxyParamCaption}
\item[{{\bf O\+T\+F\+\_\+\+File} $\ast$}]{file, }
\item[{O\+T\+F\+\_\+\+File\+Mode}]{mode}
\end{DoxyParamCaption}
)}}\label{OTF__File_8h_a2c1258db338744b0234492057f8e0ed5}


re-\/open the file when closed or suspended -\/ internal use only. 

return 1 on success, 0 otherwise 

References struct\+\_\+\+O\+T\+F\+\_\+\+File\+::externalbuffer, struct\+\_\+\+O\+T\+F\+\_\+\+File\+::file, struct\+\_\+\+O\+T\+F\+\_\+\+File\+::filename, O\+T\+F\+\_\+\+File\+Manager\+\_\+guarantee\+File(), O\+T\+F\+\_\+\+File\+Manager\+\_\+register\+File(), O\+T\+F\+\_\+\+File\+Manager\+\_\+touch\+File(), and struct\+\_\+\+O\+T\+F\+\_\+\+File\+::pos.



Referenced by O\+T\+F\+\_\+\+File\+\_\+close(), O\+T\+F\+\_\+\+File\+\_\+read(), O\+T\+F\+\_\+\+File\+\_\+seek(), and O\+T\+F\+\_\+\+File\+\_\+write().

\hypertarget{OTF__File_8h_a9ead59f66b929db1764c626b60eb3c1e}{\index{O\+T\+F\+\_\+\+File.\+h@{O\+T\+F\+\_\+\+File.\+h}!O\+T\+F\+\_\+\+File\+\_\+suspend@{O\+T\+F\+\_\+\+File\+\_\+suspend}}
\index{O\+T\+F\+\_\+\+File\+\_\+suspend@{O\+T\+F\+\_\+\+File\+\_\+suspend}!O\+T\+F\+\_\+\+File.\+h@{O\+T\+F\+\_\+\+File.\+h}}
\subsubsection[{O\+T\+F\+\_\+\+File\+\_\+suspend}]{\setlength{\rightskip}{0pt plus 5cm}void O\+T\+F\+\_\+\+File\+\_\+suspend (
\begin{DoxyParamCaption}
\item[{{\bf O\+T\+F\+\_\+\+File} $\ast$}]{file}
\end{DoxyParamCaption}
)}}\label{OTF__File_8h_a9ead59f66b929db1764c626b60eb3c1e}


suspend O\+T\+F\+\_\+\+File -\/ internal use only. 



References struct\+\_\+\+O\+T\+F\+\_\+\+File\+::externalbuffer, struct\+\_\+\+O\+T\+F\+\_\+\+File\+::file, and struct\+\_\+\+O\+T\+F\+\_\+\+File\+::pos.



Referenced by O\+T\+F\+\_\+\+File\+Manager\+\_\+suspend\+File().

