\doxysection{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
\doxysubsubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \textbf{ BYTE\+\_\+\+ORDER\+\_\+\+MAGIC}~(0x11223344)
\item 
\#define \textbf{ REVERSE\+\_\+\+SENSE\+\_\+\+SWAP\+\_\+\+INT16}(x)
\begin{DoxyCompactList}\small\item\em "{}reversed senses"{} SWAP, ARCHAN\+: This is still incorporated in Sphinx 3 because lm3g2dmp used it. \end{DoxyCompactList}\item 
\#define \textbf{ REVERSE\+\_\+\+SENSE\+\_\+\+SWAP\+\_\+\+INT32}(x)
\end{DoxyCompactItemize}
\doxysubsubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
SPHINXBASE\+\_\+\+EXPORT int32 \textbf{ bio\+\_\+readhdr} (FILE $\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 
SPHINXBASE\+\_\+\+EXPORT int32 \textbf{ bio\+\_\+writehdr\+\_\+version} (FILE $\ast$fp, char $\ast$version)
\begin{DoxyCompactList}\small\item\em Write a simple binary file header, containing only the version string. \end{DoxyCompactList}\item 
SPHINXBASE\+\_\+\+EXPORT int32 \textbf{ bio\+\_\+writehdr} (FILE $\ast$fp,...)
\item 
SPHINXBASE\+\_\+\+EXPORT 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 
SPHINXBASE\+\_\+\+EXPORT int32 \textbf{ bio\+\_\+fread} (void $\ast$buf, int32 el\+\_\+sz, int32 n\+\_\+el, FILE $\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 
SPHINXBASE\+\_\+\+EXPORT int32 \textbf{ bio\+\_\+fwrite} (void $\ast$buf, int32 el\+\_\+sz, int32 n\+\_\+el, FILE $\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 
SPHINXBASE\+\_\+\+EXPORT int32 \textbf{ bio\+\_\+fread\+\_\+1d} (void $\ast$$\ast$buf, size\+\_\+t el\+\_\+sz, uint32 $\ast$n\+\_\+el, FILE $\ast$fp, int32 sw, uint32 $\ast$ck)
\begin{DoxyCompactList}\small\item\em Read a 1-\/d array (fashioned after fread)\+: \end{DoxyCompactList}\item 
SPHINXBASE\+\_\+\+EXPORT int32 \textbf{ bio\+\_\+fread\+\_\+2d} (void $\ast$$\ast$$\ast$arr, size\+\_\+t e\+\_\+sz, uint32 $\ast$d1, uint32 $\ast$d2, FILE $\ast$fp, uint32 swap, uint32 $\ast$chksum)
\begin{DoxyCompactList}\small\item\em Read a 2-\/d matrix\+: \end{DoxyCompactList}\item 
SPHINXBASE\+\_\+\+EXPORT int32 \textbf{ bio\+\_\+fread\+\_\+3d} (void $\ast$$\ast$$\ast$$\ast$arr, size\+\_\+t e\+\_\+sz, uint32 $\ast$d1, uint32 $\ast$d2, uint32 $\ast$d3, FILE $\ast$fp, uint32 swap, uint32 $\ast$chksum)
\begin{DoxyCompactList}\small\item\em Read a 3-\/d array (set of matrices) \end{DoxyCompactList}\item 
SPHINXBASE\+\_\+\+EXPORT void \textbf{ bio\+\_\+verify\+\_\+chksum} (FILE $\ast$fp, int32 byteswap, uint32 chksum)
\begin{DoxyCompactList}\small\item\em Read and verify checksum at the end of binary file. \end{DoxyCompactList}\item 
SPHINXBASE\+\_\+\+EXPORT 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}


\doxysubsection{Detailed Description}
Cross platform binary IO to process files in sphinx3 format. 



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



\doxysubsection{Macro Definition Documentation}
\label{bio_8h_ac08e1e4728563a03ff6c937bfa8fd845} 
\index{bio.h@{bio.h}!BYTE\_ORDER\_MAGIC@{BYTE\_ORDER\_MAGIC}}
\index{BYTE\_ORDER\_MAGIC@{BYTE\_ORDER\_MAGIC}!bio.h@{bio.h}}
\doxysubsubsection{BYTE\_ORDER\_MAGIC}
{\footnotesize\ttfamily \#define BYTE\+\_\+\+ORDER\+\_\+\+MAGIC~(0x11223344)}



Definition at line \textbf{ 92} of file \textbf{ bio.\+h}.

\label{bio_8h_abf9af8ac9d8a67710371365812869c92} 
\index{bio.h@{bio.h}!REVERSE\_SENSE\_SWAP\_INT16@{REVERSE\_SENSE\_SWAP\_INT16}}
\index{REVERSE\_SENSE\_SWAP\_INT16@{REVERSE\_SENSE\_SWAP\_INT16}!bio.h@{bio.h}}
\doxysubsubsection{REVERSE\_SENSE\_SWAP\_INT16}
{\footnotesize\ttfamily \#define REVERSE\+\_\+\+SENSE\+\_\+\+SWAP\+\_\+\+INT16(\begin{DoxyParamCaption}\item[{}]{x }\end{DoxyParamCaption})}



"{}reversed senses"{} SWAP, ARCHAN\+: 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 \textbf{ 103} of file \textbf{ bio.\+h}.

\label{bio_8h_a2c277e579a007b5c46bd762a7d18b2cf} 
\index{bio.h@{bio.h}!REVERSE\_SENSE\_SWAP\_INT32@{REVERSE\_SENSE\_SWAP\_INT32}}
\index{REVERSE\_SENSE\_SWAP\_INT32@{REVERSE\_SENSE\_SWAP\_INT32}!bio.h@{bio.h}}
\doxysubsubsection{REVERSE\_SENSE\_SWAP\_INT32}
{\footnotesize\ttfamily \#define REVERSE\+\_\+\+SENSE\+\_\+\+SWAP\+\_\+\+INT32(\begin{DoxyParamCaption}\item[{}]{x }\end{DoxyParamCaption})}



Definition at line \textbf{ 104} of file \textbf{ bio.\+h}.



\doxysubsection{Function Documentation}
\label{bio_8h_a7068bb61e421bc46a6989cef3b37c833} 
\index{bio.h@{bio.h}!bio\_fread@{bio\_fread}}
\index{bio\_fread@{bio\_fread}!bio.h@{bio.h}}
\doxysubsubsection{bio\_fread()}
{\footnotesize\ttfamily SPHINXBASE\+\_\+\+EXPORT int32 bio\+\_\+fread (\begin{DoxyParamCaption}\item[{void $\ast$}]{buf,  }\item[{int32}]{el\+\_\+sz,  }\item[{int32}]{n\+\_\+el,  }\item[{FILE $\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 \textbf{ 326} of file \textbf{ bio.\+c}.



References \textbf{ bio\+\_\+fread()}.



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

\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}}
\doxysubsubsection{bio\_fread\_1d()}
{\footnotesize\ttfamily SPHINXBASE\+\_\+\+EXPORT int32 bio\+\_\+fread\+\_\+1d (\begin{DoxyParamCaption}\item[{void $\ast$$\ast$}]{buf,  }\item[{size\+\_\+t}]{el\+\_\+sz,  }\item[{uint32 $\ast$}]{n\+\_\+el,  }\item[{FILE $\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 \textbf{ 364} of file \textbf{ bio.\+c}.



References \textbf{ bio\+\_\+fread()}, \textbf{ bio\+\_\+fread\+\_\+1d()}, \textbf{ ckd\+\_\+calloc}, and \textbf{ E\+\_\+\+FATAL}.



Referenced by \textbf{ bio\+\_\+fread\+\_\+1d()}, \textbf{ bio\+\_\+fread\+\_\+2d()}, and \textbf{ bio\+\_\+fread\+\_\+3d()}.

\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}}
\doxysubsubsection{bio\_fread\_2d()}
{\footnotesize\ttfamily SPHINXBASE\+\_\+\+EXPORT 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[{FILE $\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 \textbf{ 384} of file \textbf{ bio.\+c}.



References \textbf{ bio\+\_\+fread()}, \textbf{ bio\+\_\+fread\+\_\+1d()}, \textbf{ bio\+\_\+fread\+\_\+2d()}, \textbf{ ckd\+\_\+alloc\+\_\+2d\+\_\+ptr}, and \textbf{ E\+\_\+\+ERROR\+\_\+\+SYSTEM}.



Referenced by \textbf{ bio\+\_\+fread\+\_\+2d()}.

\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}}
\doxysubsubsection{bio\_fread\_3d()}
{\footnotesize\ttfamily SPHINXBASE\+\_\+\+EXPORT 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[{FILE $\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 \textbf{ 430} of file \textbf{ bio.\+c}.



References \textbf{ bio\+\_\+fread()}, \textbf{ bio\+\_\+fread\+\_\+1d()}, \textbf{ bio\+\_\+fread\+\_\+3d()}, \textbf{ ckd\+\_\+alloc\+\_\+3d\+\_\+ptr}, and \textbf{ E\+\_\+\+ERROR\+\_\+\+SYSTEM}.



Referenced by \textbf{ bio\+\_\+fread\+\_\+3d()}, and \textbf{ feat\+\_\+read\+\_\+lda()}.

\label{bio_8h_a3b131beb20492e1a6f46c9b4dd81a64e} 
\index{bio.h@{bio.h}!bio\_fwrite@{bio\_fwrite}}
\index{bio\_fwrite@{bio\_fwrite}!bio.h@{bio.h}}
\doxysubsubsection{bio\_fwrite()}
{\footnotesize\ttfamily SPHINXBASE\+\_\+\+EXPORT int32 bio\+\_\+fwrite (\begin{DoxyParamCaption}\item[{void $\ast$}]{buf,  }\item[{int32}]{el\+\_\+sz,  }\item[{int32}]{n\+\_\+el,  }\item[{FILE $\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 \textbf{ 342} of file \textbf{ bio.\+c}.



References \textbf{ bio\+\_\+fwrite()}, \textbf{ ckd\+\_\+calloc}, and \textbf{ ckd\+\_\+free()}.



Referenced by \textbf{ bio\+\_\+fwrite()}, and \textbf{ logmath\+\_\+write()}.

\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}}
\doxysubsubsection{bio\_hdrarg\_free()}
{\footnotesize\ttfamily SPHINXBASE\+\_\+\+EXPORT 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 \textbf{ 121} of file \textbf{ bio.\+c}.



References \textbf{ bio\+\_\+hdrarg\+\_\+free()}, and \textbf{ ckd\+\_\+free()}.



Referenced by \textbf{ bio\+\_\+hdrarg\+\_\+free()}, \textbf{ bio\+\_\+readhdr()}, \textbf{ feat\+\_\+read\+\_\+lda()}, and \textbf{ logmath\+\_\+read()}.

\label{bio_8h_a5d7b47062db8f0ef5d5f7394bf424aa6} 
\index{bio.h@{bio.h}!bio\_read\_wavfile@{bio\_read\_wavfile}}
\index{bio\_read\_wavfile@{bio\_read\_wavfile}!bio.h@{bio.h}}
\doxysubsubsection{bio\_read\_wavfile()}
{\footnotesize\ttfamily SPHINXBASE\+\_\+\+EXPORT 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 \textbf{ 507} of file \textbf{ bio.\+c}.



References \textbf{ bio\+\_\+read\+\_\+wavfile()}, \textbf{ ckd\+\_\+calloc}, \textbf{ ckd\+\_\+free()}, \textbf{ E\+\_\+\+ERROR\+\_\+\+SYSTEM}, and \textbf{ E\+\_\+\+FATAL\+\_\+\+SYSTEM}.



Referenced by \textbf{ bio\+\_\+read\+\_\+wavfile()}.

\label{bio_8h_a7a155ff51740f1d9a31f7bb7b6e4bc3a} 
\index{bio.h@{bio.h}!bio\_readhdr@{bio\_readhdr}}
\index{bio\_readhdr@{bio\_readhdr}!bio.h@{bio.h}}
\doxysubsubsection{bio\_readhdr()}
{\footnotesize\ttfamily SPHINXBASE\+\_\+\+EXPORT int32 bio\+\_\+readhdr (\begin{DoxyParamCaption}\item[{FILE $\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 \textbf{ 187} of file \textbf{ bio.\+c}.



References \textbf{ bio\+\_\+hdrarg\+\_\+free()}, \textbf{ bio\+\_\+readhdr()}, \textbf{ ckd\+\_\+calloc}, \textbf{ ckd\+\_\+salloc}, and \textbf{ E\+\_\+\+ERROR}.



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

\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}}
\doxysubsubsection{bio\_verify\_chksum()}
{\footnotesize\ttfamily SPHINXBASE\+\_\+\+EXPORT void bio\+\_\+verify\+\_\+chksum (\begin{DoxyParamCaption}\item[{FILE $\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 \textbf{ 492} of file \textbf{ bio.\+c}.



References \textbf{ bio\+\_\+verify\+\_\+chksum()}, and \textbf{ E\+\_\+\+FATAL}.



Referenced by \textbf{ bio\+\_\+verify\+\_\+chksum()}, and \textbf{ logmath\+\_\+read()}.

\label{bio_8h_adc41fc6124fa3e52267c0a2c1036246f} 
\index{bio.h@{bio.h}!bio\_writehdr@{bio\_writehdr}}
\index{bio\_writehdr@{bio\_writehdr}!bio.h@{bio.h}}
\doxysubsubsection{bio\_writehdr()}
{\footnotesize\ttfamily SPHINXBASE\+\_\+\+EXPORT int32 bio\+\_\+writehdr (\begin{DoxyParamCaption}\item[{FILE $\ast$}]{fp,  }\item[{}]{... }\end{DoxyParamCaption})}



Definition at line \textbf{ 155} of file \textbf{ bio.\+c}.

\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}}
\doxysubsubsection{bio\_writehdr\_version()}
{\footnotesize\ttfamily SPHINXBASE\+\_\+\+EXPORT int32 bio\+\_\+writehdr\+\_\+version (\begin{DoxyParamCaption}\item[{FILE $\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 \textbf{ 137} of file \textbf{ bio.\+c}.



References \textbf{ bio\+\_\+writehdr\+\_\+version()}.



Referenced by \textbf{ bio\+\_\+writehdr\+\_\+version()}.

