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


Cross platform binary IO to process files in sphinx3 format.  


{\ttfamily \#include $<$stdio.\+h$>$}\newline
{\ttfamily \#include $<$stdarg.\+h$>$}\newline
{\ttfamily \#include $<$sphinxbase/sphinxbase\+\_\+export.\+h$>$}\newline
{\ttfamily \#include $<$sphinxbase/prim\+\_\+type.\+h$>$}\newline
{\ttfamily \#include $<$sphinxbase/byteorder.\+h$>$}\newline
\subsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\mbox{\label{bio_8h_ac08e1e4728563a03ff6c937bfa8fd845}} 
\#define {\bfseries B\+Y\+T\+E\+\_\+\+O\+R\+D\+E\+R\+\_\+\+M\+A\+G\+IC}~(0x11223344)
\item 
\#define \textbf{ 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\+AP, A\+R\+C\+H\+AN\+: This is still incorporated in Sphinx 3 because lm3g2dmp used it. \end{DoxyCompactList}\item 
\mbox{\label{bio_8h_a2c277e579a007b5c46bd762a7d18b2cf}} 
\#define {\bfseries R\+E\+V\+E\+R\+S\+E\+\_\+\+S\+E\+N\+S\+E\+\_\+\+S\+W\+A\+P\+\_\+\+I\+N\+T32}(x)
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+RT int32 \textbf{ bio\+\_\+readhdr} (F\+I\+LE $\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\+RT int32 \textbf{ bio\+\_\+writehdr\+\_\+version} (F\+I\+LE $\ast$fp, char $\ast$version)
\begin{DoxyCompactList}\small\item\em Write a simple binary file header, containing only the version string. \end{DoxyCompactList}\item 
\mbox{\label{bio_8h_adc41fc6124fa3e52267c0a2c1036246f}} 
S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+RT int32 {\bfseries bio\+\_\+writehdr} (F\+I\+LE $\ast$fp,...)
\item 
S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+RT void \textbf{ 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\+RT int32 \textbf{ bio\+\_\+fread} (void $\ast$buf, int32 el\+\_\+sz, int32 n\+\_\+el, F\+I\+LE $\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\+RT int32 \textbf{ bio\+\_\+fwrite} (void $\ast$buf, int32 el\+\_\+sz, int32 n\+\_\+el, F\+I\+LE $\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\+RT int32 \textbf{ bio\+\_\+fread\+\_\+1d} (void $\ast$$\ast$buf, size\+\_\+t el\+\_\+sz, uint32 $\ast$n\+\_\+el, F\+I\+LE $\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\+RT int32 \textbf{ bio\+\_\+fread\+\_\+2d} (void $\ast$$\ast$$\ast$arr, size\+\_\+t e\+\_\+sz, uint32 $\ast$d1, uint32 $\ast$d2, F\+I\+LE $\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\+RT int32 \textbf{ bio\+\_\+fread\+\_\+3d} (void $\ast$$\ast$$\ast$$\ast$arr, size\+\_\+t e\+\_\+sz, uint32 $\ast$d1, uint32 $\ast$d2, uint32 $\ast$d3, F\+I\+LE $\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\+RT void \textbf{ bio\+\_\+verify\+\_\+chksum} (F\+I\+LE $\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\+RT int16 $\ast$ \textbf{ 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 IO to process files in sphinx3 format. 



\subsection{Macro Definition Documentation}
\mbox{\label{bio_8h_abf9af8ac9d8a67710371365812869c92}} 
\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}
{\footnotesize\ttfamily \#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})}



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

Don\textquotesingle{}t think that I am very happy with it. 

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



\subsection{Function Documentation}
\mbox{\label{bio_8h_a7068bb61e421bc46a6989cef3b37c833}} 
\index{bio.\+h@{bio.\+h}!bio\+\_\+fread@{bio\+\_\+fread}}
\index{bio\+\_\+fread@{bio\+\_\+fread}!bio.\+h@{bio.\+h}}
\subsubsection{bio\+\_\+fread()}
{\footnotesize\ttfamily S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+RT int32 bio\+\_\+fread (\begin{DoxyParamCaption}\item[{void $\ast$}]{buf,  }\item[{int32}]{el\+\_\+sz,  }\item[{int32}]{n\+\_\+el,  }\item[{F\+I\+LE $\ast$}]{fp,  }\item[{int32}]{swap,  }\item[{uint32 $\ast$}]{chksum }\end{DoxyParamCaption})}



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(), and bio\+\_\+fread\+\_\+3d().

\mbox{\label{bio_8h_aaeda1ca5a5c0ca5a9e5b4820c442bbe5}} 
\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()}
{\footnotesize\ttfamily S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+RT int32 bio\+\_\+fread\+\_\+1d (\begin{DoxyParamCaption}\item[{void $\ast$$\ast$}]{buf,  }\item[{size\+\_\+t}]{el\+\_\+sz,  }\item[{uint32 $\ast$}]{n\+\_\+el,  }\item[{F\+I\+LE $\ast$}]{fp,  }\item[{int32}]{sw,  }\item[{uint32 $\ast$}]{ck }\end{DoxyParamCaption})}



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\+AL.



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

\mbox{\label{bio_8h_a70604d0f8035f0868f9284fa82e4fdb8}} 
\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()}
{\footnotesize\ttfamily S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+RT 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\+LE $\ast$}]{fp,  }\item[{uint32}]{swap,  }\item[{uint32 $\ast$}]{chksum }\end{DoxyParamCaption})}



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\+EM.

\mbox{\label{bio_8h_aca6a6b71d02b9e5ca6b136a28640e0c1}} 
\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()}
{\footnotesize\ttfamily S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+RT 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\+LE $\ast$}]{fp,  }\item[{uint32}]{swap,  }\item[{uint32 $\ast$}]{chksum }\end{DoxyParamCaption})}



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\+EM.

\mbox{\label{bio_8h_a3b131beb20492e1a6f46c9b4dd81a64e}} 
\index{bio.\+h@{bio.\+h}!bio\+\_\+fwrite@{bio\+\_\+fwrite}}
\index{bio\+\_\+fwrite@{bio\+\_\+fwrite}!bio.\+h@{bio.\+h}}
\subsubsection{bio\+\_\+fwrite()}
{\footnotesize\ttfamily S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+RT int32 bio\+\_\+fwrite (\begin{DoxyParamCaption}\item[{void $\ast$}]{buf,  }\item[{int32}]{el\+\_\+sz,  }\item[{int32}]{n\+\_\+el,  }\item[{F\+I\+LE $\ast$}]{fp,  }\item[{int32}]{swap,  }\item[{uint32 $\ast$}]{chksum }\end{DoxyParamCaption})}



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().

\mbox{\label{bio_8h_adb3c858a50381aeff022ccd4271af2d9}} 
\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()}
{\footnotesize\ttfamily S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+RT void bio\+\_\+hdrarg\+\_\+free (\begin{DoxyParamCaption}\item[{char $\ast$$\ast$}]{name,  }\item[{char $\ast$$\ast$}]{val }\end{DoxyParamCaption})}



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.

\mbox{\label{bio_8h_afb2a720bfe1c63d5280d343715292d61}} 
\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()}
{\footnotesize\ttfamily S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+RT 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})}



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.

\mbox{\label{bio_8h_a7a155ff51740f1d9a31f7bb7b6e4bc3a}} 
\index{bio.\+h@{bio.\+h}!bio\+\_\+readhdr@{bio\+\_\+readhdr}}
\index{bio\+\_\+readhdr@{bio\+\_\+readhdr}!bio.\+h@{bio.\+h}}
\subsubsection{bio\+\_\+readhdr()}
{\footnotesize\ttfamily S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+RT int32 bio\+\_\+readhdr (\begin{DoxyParamCaption}\item[{F\+I\+LE $\ast$}]{fp,  }\item[{char $\ast$$\ast$$\ast$}]{name,  }\item[{char $\ast$$\ast$$\ast$}]{val,  }\item[{int32 $\ast$}]{swap }\end{DoxyParamCaption})}



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.

\mbox{\label{bio_8h_ad07e2ee9f2f01d3ff3232008098295a0}} 
\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()}
{\footnotesize\ttfamily S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+RT void bio\+\_\+verify\+\_\+chksum (\begin{DoxyParamCaption}\item[{F\+I\+LE $\ast$}]{fp,  }\item[{int32}]{byteswap,  }\item[{uint32}]{chksum }\end{DoxyParamCaption})}



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\+AL.

\mbox{\label{bio_8h_a9662c09be1f18377488dedb8e7ca0bfd}} 
\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()}
{\footnotesize\ttfamily S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+RT int32 bio\+\_\+writehdr\+\_\+version (\begin{DoxyParamCaption}\item[{F\+I\+LE $\ast$}]{fp,  }\item[{char $\ast$}]{version }\end{DoxyParamCaption})}



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.

