\section{include/sphinxbase/bio.h File Reference}
\label{bio_8h}\index{include/sphinxbase/bio.\+h@{include/sphinxbase/bio.\+h}}


Cross platform binary I\+O to process files in sphinx3 format.  


{\ttfamily \#include $<$stdio.\+h$>$}\\*
{\ttfamily \#include $<$stdarg.\+h$>$}\\*
{\ttfamily \#include $<$sphinxbase/sphinxbase\+\_\+export.\+h$>$}\\*
{\ttfamily \#include $<$sphinxbase/prim\+\_\+type.\+h$>$}\\*
{\ttfamily \#include $<$sphinxbase/byteorder.\+h$>$}\\*
\subsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define {\bfseries B\+Y\+T\+E\+\_\+\+O\+R\+D\+E\+R\+\_\+\+M\+A\+G\+I\+C}~(0x11223344)\label{bio_8h_ac08e1e4728563a03ff6c937bfa8fd845}

\item 
\#define {\bf R\+E\+V\+E\+R\+S\+E\+\_\+\+S\+E\+N\+S\+E\+\_\+\+S\+W\+A\+P\+\_\+\+I\+N\+T16}(x)
\begin{DoxyCompactList}\small\item\em \char`\"{}reversed senses\char`\"{} S\+W\+A\+P, A\+R\+C\+H\+A\+N\+: This is still incorporated in Sphinx 3 because lm3g2dmp used it. \end{DoxyCompactList}\item 
\#define {\bfseries R\+E\+V\+E\+R\+S\+E\+\_\+\+S\+E\+N\+S\+E\+\_\+\+S\+W\+A\+P\+\_\+\+I\+N\+T32}(x)\label{bio_8h_a2c277e579a007b5c46bd762a7d18b2cf}

\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T int32 {\bf bio\+\_\+readhdr} (F\+I\+L\+E $\ast$fp, char $\ast$$\ast$$\ast$name, char $\ast$$\ast$$\ast$val, int32 $\ast$swap)
\begin{DoxyCompactList}\small\item\em Read binary file format header\+: has the following format. \end{DoxyCompactList}\item 
S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T int32 {\bf bio\+\_\+writehdr\+\_\+version} (F\+I\+L\+E $\ast$fp, char $\ast$version)
\begin{DoxyCompactList}\small\item\em Write a simple binary file header, containing only the version string. \end{DoxyCompactList}\item 
S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T int32 {\bfseries bio\+\_\+writehdr} (F\+I\+L\+E $\ast$fp,...)\label{bio_8h_adc41fc6124fa3e52267c0a2c1036246f}

\item 
S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T void {\bf bio\+\_\+hdrarg\+\_\+free} (char $\ast$$\ast$name, char $\ast$$\ast$val)
\begin{DoxyCompactList}\small\item\em Free name and value strings previously allocated and returned by bio\+\_\+readhdr. \end{DoxyCompactList}\item 
S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T int32 {\bf bio\+\_\+fread} (void $\ast$buf, int32 el\+\_\+sz, int32 n\+\_\+el, F\+I\+L\+E $\ast$fp, int32 swap, uint32 $\ast$chksum)
\begin{DoxyCompactList}\small\item\em Like fread but perform byteswapping and accumulate checksum (the 2 extra arguments). \end{DoxyCompactList}\item 
S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T int32 {\bf bio\+\_\+fwrite} (void $\ast$buf, int32 el\+\_\+sz, int32 n\+\_\+el, F\+I\+L\+E $\ast$fp, int32 swap, uint32 $\ast$chksum)
\begin{DoxyCompactList}\small\item\em Like fwrite but perform byteswapping and accumulate checksum (the 2 extra arguments). \end{DoxyCompactList}\item 
S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T int32 {\bf bio\+\_\+fread\+\_\+1d} (void $\ast$$\ast$buf, size\+\_\+t el\+\_\+sz, uint32 $\ast$n\+\_\+el, F\+I\+L\+E $\ast$fp, int32 sw, uint32 $\ast$ck)
\begin{DoxyCompactList}\small\item\em Read a 1-\/d array (fashioned after fread)\+: \end{DoxyCompactList}\item 
S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T int32 {\bf bio\+\_\+fread\+\_\+2d} (void $\ast$$\ast$$\ast$arr, size\+\_\+t e\+\_\+sz, uint32 $\ast$d1, uint32 $\ast$d2, F\+I\+L\+E $\ast$fp, uint32 swap, uint32 $\ast$chksum)
\begin{DoxyCompactList}\small\item\em Read a 2-\/d matrix\+: \end{DoxyCompactList}\item 
S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T int32 {\bf bio\+\_\+fread\+\_\+3d} (void $\ast$$\ast$$\ast$$\ast$arr, size\+\_\+t e\+\_\+sz, uint32 $\ast$d1, uint32 $\ast$d2, uint32 $\ast$d3, F\+I\+L\+E $\ast$fp, uint32 swap, uint32 $\ast$chksum)
\begin{DoxyCompactList}\small\item\em Read a 3-\/d array (set of matrices) \end{DoxyCompactList}\item 
S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T void {\bf bio\+\_\+verify\+\_\+chksum} (F\+I\+L\+E $\ast$fp, int32 byteswap, uint32 chksum)
\begin{DoxyCompactList}\small\item\em Read and verify checksum at the end of binary file. \end{DoxyCompactList}\item 
S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T int16 $\ast$ {\bf bio\+\_\+read\+\_\+wavfile} (char const $\ast$directory, char const $\ast$filename, char const $\ast$extension, int32 header, int32 endian, int32 $\ast$nsamps)
\begin{DoxyCompactList}\small\item\em Read raw data from the wav file. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Cross platform binary I\+O to process files in sphinx3 format. 



Definition in file {\bf bio.\+h}.



\subsection{Macro Definition Documentation}
\index{bio.\+h@{bio.\+h}!R\+E\+V\+E\+R\+S\+E\+\_\+\+S\+E\+N\+S\+E\+\_\+\+S\+W\+A\+P\+\_\+\+I\+N\+T16@{R\+E\+V\+E\+R\+S\+E\+\_\+\+S\+E\+N\+S\+E\+\_\+\+S\+W\+A\+P\+\_\+\+I\+N\+T16}}
\index{R\+E\+V\+E\+R\+S\+E\+\_\+\+S\+E\+N\+S\+E\+\_\+\+S\+W\+A\+P\+\_\+\+I\+N\+T16@{R\+E\+V\+E\+R\+S\+E\+\_\+\+S\+E\+N\+S\+E\+\_\+\+S\+W\+A\+P\+\_\+\+I\+N\+T16}!bio.\+h@{bio.\+h}}
\subsubsection[{R\+E\+V\+E\+R\+S\+E\+\_\+\+S\+E\+N\+S\+E\+\_\+\+S\+W\+A\+P\+\_\+\+I\+N\+T16}]{\setlength{\rightskip}{0pt plus 5cm}\#define R\+E\+V\+E\+R\+S\+E\+\_\+\+S\+E\+N\+S\+E\+\_\+\+S\+W\+A\+P\+\_\+\+I\+N\+T16(
\begin{DoxyParamCaption}
\item[{}]{x}
\end{DoxyParamCaption}
)}\label{bio_8h_abf9af8ac9d8a67710371365812869c92}


\char`\"{}reversed senses\char`\"{} S\+W\+A\+P, A\+R\+C\+H\+A\+N\+: This is still incorporated in Sphinx 3 because lm3g2dmp used it. 

Don't think that I am very happy with it. 

Definition at line 103 of file bio.\+h.



\subsection{Function Documentation}
\index{bio.\+h@{bio.\+h}!bio\+\_\+fread@{bio\+\_\+fread}}
\index{bio\+\_\+fread@{bio\+\_\+fread}!bio.\+h@{bio.\+h}}
\subsubsection[{bio\+\_\+fread}]{\setlength{\rightskip}{0pt plus 5cm}S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T int32 bio\+\_\+fread (
\begin{DoxyParamCaption}
\item[{void $\ast$}]{buf, }
\item[{int32}]{el\+\_\+sz, }
\item[{int32}]{n\+\_\+el, }
\item[{F\+I\+L\+E $\ast$}]{fp, }
\item[{int32}]{swap, }
\item[{uint32 $\ast$}]{chksum}
\end{DoxyParamCaption}
)}\label{bio_8h_a7068bb61e421bc46a6989cef3b37c833}


Like fread but perform byteswapping and accumulate checksum (the 2 extra arguments). 

But unlike fread, returns -\/1 if required number of elements (n\+\_\+el) not read; also, no byteswapping or checksum accumulation is performed in that case. 
\begin{DoxyParams}{Parameters}
{\em fp} & In\+: An input file pointer \\
\hline
{\em swap} & In\+: Byteswap iff (swap != 0) \\
\hline
{\em chksum} & In/\+Out\+: Accumulated checksum \\
\hline
\end{DoxyParams}


Definition at line 326 of file bio.\+c.



Referenced by bio\+\_\+fread\+\_\+1d(), bio\+\_\+fread\+\_\+2d(), bio\+\_\+fread\+\_\+3d(), and logmath\+\_\+read().

\index{bio.\+h@{bio.\+h}!bio\+\_\+fread\+\_\+1d@{bio\+\_\+fread\+\_\+1d}}
\index{bio\+\_\+fread\+\_\+1d@{bio\+\_\+fread\+\_\+1d}!bio.\+h@{bio.\+h}}
\subsubsection[{bio\+\_\+fread\+\_\+1d}]{\setlength{\rightskip}{0pt plus 5cm}S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T int32 bio\+\_\+fread\+\_\+1d (
\begin{DoxyParamCaption}
\item[{void $\ast$$\ast$}]{buf, }
\item[{size\+\_\+t}]{el\+\_\+sz, }
\item[{uint32 $\ast$}]{n\+\_\+el, }
\item[{F\+I\+L\+E $\ast$}]{fp, }
\item[{int32}]{sw, }
\item[{uint32 $\ast$}]{ck}
\end{DoxyParamCaption}
)}\label{bio_8h_aaeda1ca5a5c0ca5a9e5b4820c442bbe5}


Read a 1-\/d array (fashioned after fread)\+: 


\begin{DoxyItemize}
\item 4-\/byte array size (returned in n\+\_\+el)
\item memory allocated for the array and read (returned in buf)
\end{DoxyItemize}

Byteswapping and checksum accumulation performed as necessary. Fails fatally if expected data not read. Return value\+: number of array elements allocated and read; -\/1 if error. 
\begin{DoxyParams}{Parameters}
{\em buf} & Out\+: contains array data; allocated by this function; can be freed using ckd\+\_\+free \\
\hline
{\em el\+\_\+sz} & In\+: Array element size \\
\hline
{\em n\+\_\+el} & Out\+: Number of array elements allocated/read \\
\hline
{\em fp} & In\+: File to read \\
\hline
{\em sw} & In\+: Byteswap iff (swap != 0) \\
\hline
{\em ck} & In/\+Out\+: Accumulated checksum \\
\hline
\end{DoxyParams}


Definition at line 364 of file bio.\+c.



References bio\+\_\+fread(), ckd\+\_\+calloc, and E\+\_\+\+F\+A\+T\+A\+L.



Referenced by bio\+\_\+fread\+\_\+2d(), and bio\+\_\+fread\+\_\+3d().

\index{bio.\+h@{bio.\+h}!bio\+\_\+fread\+\_\+2d@{bio\+\_\+fread\+\_\+2d}}
\index{bio\+\_\+fread\+\_\+2d@{bio\+\_\+fread\+\_\+2d}!bio.\+h@{bio.\+h}}
\subsubsection[{bio\+\_\+fread\+\_\+2d}]{\setlength{\rightskip}{0pt plus 5cm}S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T int32 bio\+\_\+fread\+\_\+2d (
\begin{DoxyParamCaption}
\item[{void $\ast$$\ast$$\ast$}]{arr, }
\item[{size\+\_\+t}]{e\+\_\+sz, }
\item[{uint32 $\ast$}]{d1, }
\item[{uint32 $\ast$}]{d2, }
\item[{F\+I\+L\+E $\ast$}]{fp, }
\item[{uint32}]{swap, }
\item[{uint32 $\ast$}]{chksum}
\end{DoxyParamCaption}
)}\label{bio_8h_a70604d0f8035f0868f9284fa82e4fdb8}


Read a 2-\/d matrix\+: 


\begin{DoxyItemize}
\item 4-\/byte \# rows, \# columns (returned in d1, d2, d3)
\item memory allocated for the array and read (returned in buf)
\end{DoxyItemize}

Byteswapping and checksum accumulation performed as necessary. Fails fatally if expected data not read. Return value\+: number of array elements allocated and read; -\/1 if error. 

Definition at line 384 of file bio.\+c.



References bio\+\_\+fread(), bio\+\_\+fread\+\_\+1d(), ckd\+\_\+alloc\+\_\+2d\+\_\+ptr, and E\+\_\+\+E\+R\+R\+O\+R\+\_\+\+S\+Y\+S\+T\+E\+M.

\index{bio.\+h@{bio.\+h}!bio\+\_\+fread\+\_\+3d@{bio\+\_\+fread\+\_\+3d}}
\index{bio\+\_\+fread\+\_\+3d@{bio\+\_\+fread\+\_\+3d}!bio.\+h@{bio.\+h}}
\subsubsection[{bio\+\_\+fread\+\_\+3d}]{\setlength{\rightskip}{0pt plus 5cm}S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T int32 bio\+\_\+fread\+\_\+3d (
\begin{DoxyParamCaption}
\item[{void $\ast$$\ast$$\ast$$\ast$}]{arr, }
\item[{size\+\_\+t}]{e\+\_\+sz, }
\item[{uint32 $\ast$}]{d1, }
\item[{uint32 $\ast$}]{d2, }
\item[{uint32 $\ast$}]{d3, }
\item[{F\+I\+L\+E $\ast$}]{fp, }
\item[{uint32}]{swap, }
\item[{uint32 $\ast$}]{chksum}
\end{DoxyParamCaption}
)}\label{bio_8h_aca6a6b71d02b9e5ca6b136a28640e0c1}


Read a 3-\/d array (set of matrices) 


\begin{DoxyItemize}
\item 4-\/byte \# matrices, \# rows, \# columns (returned in d1, d2, d3)
\item memory allocated for the array and read (returned in buf)
\end{DoxyItemize}

Byteswapping and checksum accumulation performed as necessary. Fails fatally if expected data not read. Return value\+: number of array elements allocated and read; -\/1 if error. 

Definition at line 430 of file bio.\+c.



References bio\+\_\+fread(), bio\+\_\+fread\+\_\+1d(), ckd\+\_\+alloc\+\_\+3d\+\_\+ptr, and E\+\_\+\+E\+R\+R\+O\+R\+\_\+\+S\+Y\+S\+T\+E\+M.



Referenced by feat\+\_\+read\+\_\+lda().

\index{bio.\+h@{bio.\+h}!bio\+\_\+fwrite@{bio\+\_\+fwrite}}
\index{bio\+\_\+fwrite@{bio\+\_\+fwrite}!bio.\+h@{bio.\+h}}
\subsubsection[{bio\+\_\+fwrite}]{\setlength{\rightskip}{0pt plus 5cm}S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T int32 bio\+\_\+fwrite (
\begin{DoxyParamCaption}
\item[{void $\ast$}]{buf, }
\item[{int32}]{el\+\_\+sz, }
\item[{int32}]{n\+\_\+el, }
\item[{F\+I\+L\+E $\ast$}]{fp, }
\item[{int32}]{swap, }
\item[{uint32 $\ast$}]{chksum}
\end{DoxyParamCaption}
)}\label{bio_8h_a3b131beb20492e1a6f46c9b4dd81a64e}


Like fwrite but perform byteswapping and accumulate checksum (the 2 extra arguments). 

\begin{DoxyReturn}{Returns}
the number of elemens written (like fwrite). 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em fp} & In\+: An input file pointer \\
\hline
{\em swap} & In\+: Byteswap iff (swap != 0) \\
\hline
{\em chksum} & In/\+Out\+: Accumulated checksum \\
\hline
\end{DoxyParams}


Definition at line 342 of file bio.\+c.



References ckd\+\_\+calloc, and ckd\+\_\+free().



Referenced by logmath\+\_\+write().

\index{bio.\+h@{bio.\+h}!bio\+\_\+hdrarg\+\_\+free@{bio\+\_\+hdrarg\+\_\+free}}
\index{bio\+\_\+hdrarg\+\_\+free@{bio\+\_\+hdrarg\+\_\+free}!bio.\+h@{bio.\+h}}
\subsubsection[{bio\+\_\+hdrarg\+\_\+free}]{\setlength{\rightskip}{0pt plus 5cm}S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T void bio\+\_\+hdrarg\+\_\+free (
\begin{DoxyParamCaption}
\item[{char $\ast$$\ast$}]{name, }
\item[{char $\ast$$\ast$}]{val}
\end{DoxyParamCaption}
)}\label{bio_8h_adb3c858a50381aeff022ccd4271af2d9}


Free name and value strings previously allocated and returned by bio\+\_\+readhdr. 


\begin{DoxyParams}{Parameters}
{\em name} & In\+: Array previously returned by bio\+\_\+readhdr \\
\hline
{\em val} & In\+: Array previously returned by bio\+\_\+readhdr \\
\hline
\end{DoxyParams}


Definition at line 121 of file bio.\+c.



References ckd\+\_\+free().



Referenced by bio\+\_\+readhdr(), feat\+\_\+read\+\_\+lda(), and logmath\+\_\+read().

\index{bio.\+h@{bio.\+h}!bio\+\_\+read\+\_\+wavfile@{bio\+\_\+read\+\_\+wavfile}}
\index{bio\+\_\+read\+\_\+wavfile@{bio\+\_\+read\+\_\+wavfile}!bio.\+h@{bio.\+h}}
\subsubsection[{bio\+\_\+read\+\_\+wavfile}]{\setlength{\rightskip}{0pt plus 5cm}S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T int16$\ast$ bio\+\_\+read\+\_\+wavfile (
\begin{DoxyParamCaption}
\item[{char const $\ast$}]{directory, }
\item[{char const $\ast$}]{filename, }
\item[{char const $\ast$}]{extension, }
\item[{int32}]{header, }
\item[{int32}]{endian, }
\item[{int32 $\ast$}]{nsamps}
\end{DoxyParamCaption}
)}\label{bio_8h_afb2a720bfe1c63d5280d343715292d61}


Read raw data from the wav file. 


\begin{DoxyParams}{Parameters}
{\em directory} & the folder where the file is located \\
\hline
{\em filename} & the name of the file \\
\hline
{\em extension} & file extension \\
\hline
{\em header} & the size of the header to skip usually 44 bytes. \\
\hline
{\em endian} & Endian of the data \\
\hline
{\em nsamps} & number of samples read \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
pointer to the data 
\end{DoxyReturn}


Definition at line 507 of file bio.\+c.



References ckd\+\_\+calloc, ckd\+\_\+free(), E\+\_\+\+E\+R\+R\+O\+R\+\_\+\+S\+Y\+S\+T\+E\+M, and E\+\_\+\+F\+A\+T\+A\+L\+\_\+\+S\+Y\+S\+T\+E\+M.

\index{bio.\+h@{bio.\+h}!bio\+\_\+readhdr@{bio\+\_\+readhdr}}
\index{bio\+\_\+readhdr@{bio\+\_\+readhdr}!bio.\+h@{bio.\+h}}
\subsubsection[{bio\+\_\+readhdr}]{\setlength{\rightskip}{0pt plus 5cm}S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T int32 bio\+\_\+readhdr (
\begin{DoxyParamCaption}
\item[{F\+I\+L\+E $\ast$}]{fp, }
\item[{char $\ast$$\ast$$\ast$}]{name, }
\item[{char $\ast$$\ast$$\ast$}]{val, }
\item[{int32 $\ast$}]{swap}
\end{DoxyParamCaption}
)}\label{bio_8h_a7a155ff51740f1d9a31f7bb7b6e4bc3a}


Read binary file format header\+: has the following format. 


\begin{DoxyPre}
    s3
    <argument-name> <argument-value>
    <argument-name> <argument-value>
    ...
    endhdr
    4-byte byte-order word used to find file byte ordering relative to host machine.
\end{DoxyPre}
 Lines beginning with \# are ignored. Memory for name and val allocated by this function; use bio\+\_\+hdrarg\+\_\+free to free them. \begin{DoxyReturn}{Returns}
\+: 0 if successful, -\/1 otherwise. 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em fp} & In\+: File to read \\
\hline
{\em name} & Out\+: array of argument name strings read \\
\hline
{\em val} & Out\+: corresponding value strings read \\
\hline
{\em swap} & Out\+: file needs byteswapping iff ($\ast$swap) \\
\hline
\end{DoxyParams}


Definition at line 187 of file bio.\+c.



References bio\+\_\+hdrarg\+\_\+free(), ckd\+\_\+calloc, ckd\+\_\+salloc, and E\+\_\+\+E\+R\+R\+O\+R.



Referenced by feat\+\_\+read\+\_\+lda(), and logmath\+\_\+read().

\index{bio.\+h@{bio.\+h}!bio\+\_\+verify\+\_\+chksum@{bio\+\_\+verify\+\_\+chksum}}
\index{bio\+\_\+verify\+\_\+chksum@{bio\+\_\+verify\+\_\+chksum}!bio.\+h@{bio.\+h}}
\subsubsection[{bio\+\_\+verify\+\_\+chksum}]{\setlength{\rightskip}{0pt plus 5cm}S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T void bio\+\_\+verify\+\_\+chksum (
\begin{DoxyParamCaption}
\item[{F\+I\+L\+E $\ast$}]{fp, }
\item[{int32}]{byteswap, }
\item[{uint32}]{chksum}
\end{DoxyParamCaption}
)}\label{bio_8h_ad07e2ee9f2f01d3ff3232008098295a0}


Read and verify checksum at the end of binary file. 

Fails fatally if there is a mismatch. 
\begin{DoxyParams}{Parameters}
{\em fp} & In\+: File to read \\
\hline
{\em byteswap} & In\+: Byteswap iff (swap != 0) \\
\hline
{\em chksum} & In\+: Value to compare with checksum in file \\
\hline
\end{DoxyParams}


Definition at line 492 of file bio.\+c.



References E\+\_\+\+F\+A\+T\+A\+L.



Referenced by logmath\+\_\+read().

\index{bio.\+h@{bio.\+h}!bio\+\_\+writehdr\+\_\+version@{bio\+\_\+writehdr\+\_\+version}}
\index{bio\+\_\+writehdr\+\_\+version@{bio\+\_\+writehdr\+\_\+version}!bio.\+h@{bio.\+h}}
\subsubsection[{bio\+\_\+writehdr\+\_\+version}]{\setlength{\rightskip}{0pt plus 5cm}S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T int32 bio\+\_\+writehdr\+\_\+version (
\begin{DoxyParamCaption}
\item[{F\+I\+L\+E $\ast$}]{fp, }
\item[{char $\ast$}]{version}
\end{DoxyParamCaption}
)}\label{bio_8h_a9662c09be1f18377488dedb8e7ca0bfd}


Write a simple binary file header, containing only the version string. 

Also write the byte order magic word. \begin{DoxyReturn}{Returns}
\+: 0 if successful, -\/1 otherwise. 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em fp} & Output\+: File to write \\
\hline
{\em version} & Input\+: A string of version \\
\hline
\end{DoxyParams}


Definition at line 137 of file bio.\+c.

