\doxysection{err.\+h}
\label{err_8h_source}\index{include/sphinxbase/err.h@{include/sphinxbase/err.h}}
\textbf{ Go to the documentation of this file.}
\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{comment}{/*\ -\/*-\/\ c-\/basic-\/offset:\ 4;\ indent-\/tabs-\/mode:\ nil\ -\/*-\/\ */}}
\DoxyCodeLine{00002\ \textcolor{comment}{/*\ ====================================================================}}
\DoxyCodeLine{00003\ \textcolor{comment}{\ *\ Copyright\ (c)\ 1999-\/2004\ Carnegie\ Mellon\ University.\ \ All\ rights}}
\DoxyCodeLine{00004\ \textcolor{comment}{\ *\ reserved.}}
\DoxyCodeLine{00005\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00006\ \textcolor{comment}{\ *\ Redistribution\ and\ use\ in\ source\ and\ binary\ forms,\ with\ or\ without}}
\DoxyCodeLine{00007\ \textcolor{comment}{\ *\ modification,\ are\ permitted\ provided\ that\ the\ following\ conditions}}
\DoxyCodeLine{00008\ \textcolor{comment}{\ *\ are\ met:}}
\DoxyCodeLine{00009\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00010\ \textcolor{comment}{\ *\ 1.\ Redistributions\ of\ source\ code\ must\ retain\ the\ above\ copyright}}
\DoxyCodeLine{00011\ \textcolor{comment}{\ *\ \ \ \ notice,\ this\ list\ of\ conditions\ and\ the\ following\ disclaimer.\ }}
\DoxyCodeLine{00012\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00013\ \textcolor{comment}{\ *\ 2.\ Redistributions\ in\ binary\ form\ must\ reproduce\ the\ above\ copyright}}
\DoxyCodeLine{00014\ \textcolor{comment}{\ *\ \ \ \ notice,\ this\ list\ of\ conditions\ and\ the\ following\ disclaimer\ in}}
\DoxyCodeLine{00015\ \textcolor{comment}{\ *\ \ \ \ the\ documentation\ and/or\ other\ materials\ provided\ with\ the}}
\DoxyCodeLine{00016\ \textcolor{comment}{\ *\ \ \ \ distribution.}}
\DoxyCodeLine{00017\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00018\ \textcolor{comment}{\ *\ This\ work\ was\ supported\ in\ part\ by\ funding\ from\ the\ Defense\ Advanced\ }}
\DoxyCodeLine{00019\ \textcolor{comment}{\ *\ Research\ Projects\ Agency\ and\ the\ National\ Science\ Foundation\ of\ the\ }}
\DoxyCodeLine{00020\ \textcolor{comment}{\ *\ United\ States\ of\ America,\ and\ the\ CMU\ Sphinx\ Speech\ Consortium.}}
\DoxyCodeLine{00021\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00022\ \textcolor{comment}{\ *\ THIS\ SOFTWARE\ IS\ PROVIDED\ BY\ CARNEGIE\ MELLON\ UNIVERSITY\ \`{}\`{}AS\ IS''\ AND\ }}
\DoxyCodeLine{00023\ \textcolor{comment}{\ *\ ANY\ EXPRESSED\ OR\ IMPLIED\ WARRANTIES,\ INCLUDING,\ BUT\ NOT\ LIMITED\ TO,\ }}
\DoxyCodeLine{00024\ \textcolor{comment}{\ *\ THE\ IMPLIED\ WARRANTIES\ OF\ MERCHANTABILITY\ AND\ FITNESS\ FOR\ A\ PARTICULAR}}
\DoxyCodeLine{00025\ \textcolor{comment}{\ *\ PURPOSE\ ARE\ DISCLAIMED.\ \ IN\ NO\ EVENT\ SHALL\ CARNEGIE\ MELLON\ UNIVERSITY}}
\DoxyCodeLine{00026\ \textcolor{comment}{\ *\ NOR\ ITS\ EMPLOYEES\ BE\ LIABLE\ FOR\ ANY\ DIRECT,\ INDIRECT,\ INCIDENTAL,}}
\DoxyCodeLine{00027\ \textcolor{comment}{\ *\ SPECIAL,\ EXEMPLARY,\ OR\ CONSEQUENTIAL\ DAMAGES\ (INCLUDING,\ BUT\ NOT\ }}
\DoxyCodeLine{00028\ \textcolor{comment}{\ *\ LIMITED\ TO,\ PROCUREMENT\ OF\ SUBSTITUTE\ GOODS\ OR\ SERVICES;\ LOSS\ OF\ USE,\ }}
\DoxyCodeLine{00029\ \textcolor{comment}{\ *\ DATA,\ OR\ PROFITS;\ OR\ BUSINESS\ INTERRUPTION)\ HOWEVER\ CAUSED\ AND\ ON\ ANY\ }}
\DoxyCodeLine{00030\ \textcolor{comment}{\ *\ THEORY\ OF\ LIABILITY,\ WHETHER\ IN\ CONTRACT,\ STRICT\ LIABILITY,\ OR\ TORT\ }}
\DoxyCodeLine{00031\ \textcolor{comment}{\ *\ (INCLUDING\ NEGLIGENCE\ OR\ OTHERWISE)\ ARISING\ IN\ ANY\ WAY\ OUT\ OF\ THE\ USE\ }}
\DoxyCodeLine{00032\ \textcolor{comment}{\ *\ OF\ THIS\ SOFTWARE,\ EVEN\ IF\ ADVISED\ OF\ THE\ POSSIBILITY\ OF\ SUCH\ DAMAGE.}}
\DoxyCodeLine{00033\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00034\ \textcolor{comment}{\ *\ ====================================================================}}
\DoxyCodeLine{00035\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00036\ \textcolor{comment}{\ */}}
\DoxyCodeLine{00037\ }
\DoxyCodeLine{00038\ \textcolor{preprocessor}{\#ifndef\ \_LIBUTIL\_ERR\_H\_}}
\DoxyCodeLine{00039\ \textcolor{preprocessor}{\#define\ \_LIBUTIL\_ERR\_H\_}}
\DoxyCodeLine{00040\ }
\DoxyCodeLine{00041\ \textcolor{preprocessor}{\#include\ <stdarg.h>}}
\DoxyCodeLine{00042\ \textcolor{preprocessor}{\#include\ <stdio.h>}}
\DoxyCodeLine{00043\ \textcolor{preprocessor}{\#ifndef\ \_WIN32\_WCE}}
\DoxyCodeLine{00044\ \textcolor{preprocessor}{\#include\ <errno.h>}}
\DoxyCodeLine{00045\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00046\ }
\DoxyCodeLine{00047\ \textcolor{comment}{/*\ Win32/WinCE\ DLL\ gunk\ */}}
\DoxyCodeLine{00048\ \textcolor{preprocessor}{\#include\ <sphinxbase/sphinxbase\_export.h>}}
\DoxyCodeLine{00049\ }
\DoxyCodeLine{00067\ \textcolor{preprocessor}{\#ifdef\ \_\_cplusplus}}
\DoxyCodeLine{00068\ \textcolor{keyword}{extern}\ \textcolor{stringliteral}{"{}C"{}}\ \{}
\DoxyCodeLine{00069\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00070\ \textcolor{preprocessor}{\#if\ 0}}
\DoxyCodeLine{00071\ \textcolor{comment}{/*\ Fool\ Emacs.\ */}}
\DoxyCodeLine{00072\ \}}
\DoxyCodeLine{00073\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00074\ }
\DoxyCodeLine{00075\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00076\ \textcolor{keywordtype}{void}\ \_E\_\_pr\_header(\textcolor{keywordtype}{char}\ \textcolor{keyword}{const}\ *file,\ \textcolor{keywordtype}{long}\ line,\ \textcolor{keywordtype}{char}\ \textcolor{keyword}{const}\ *msg);}
\DoxyCodeLine{00077\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00078\ \textcolor{keywordtype}{void}\ \_E\_\_pr\_debug\_header(\textcolor{keywordtype}{char}\ \textcolor{keyword}{const}\ *file,\ \textcolor{keywordtype}{long}\ line,\ \textcolor{keywordtype}{int}\ level);}
\DoxyCodeLine{00079\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00080\ \textcolor{keywordtype}{void}\ \_E\_\_pr\_info\_header(\textcolor{keywordtype}{char}\ \textcolor{keyword}{const}\ *file,\ \textcolor{keywordtype}{long}\ line,\ \textcolor{keywordtype}{char}\ \textcolor{keyword}{const}\ *tag);}
\DoxyCodeLine{00081\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00082\ \textcolor{keywordtype}{void}\ \_E\_\_pr\_info\_header\_wofn(\textcolor{keywordtype}{char}\ \textcolor{keyword}{const}\ *msg);}
\DoxyCodeLine{00083\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00084\ \textcolor{keywordtype}{void}\ \_E\_\_pr\_warn(\textcolor{keywordtype}{char}\ \textcolor{keyword}{const}\ *fmt,\ ...);}
\DoxyCodeLine{00085\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00086\ \textcolor{keywordtype}{void}\ \_E\_\_pr\_info(\textcolor{keywordtype}{char}\ \textcolor{keyword}{const}\ *fmt,\ ...);}
\DoxyCodeLine{00087\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00088\ \textcolor{keywordtype}{void}\ \_E\_\_die\_error(\textcolor{keywordtype}{char}\ \textcolor{keyword}{const}\ *fmt,\ ...);}
\DoxyCodeLine{00089\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00090\ \textcolor{keywordtype}{void}\ \_E\_\_abort\_error(\textcolor{keywordtype}{char}\ \textcolor{keyword}{const}\ *fmt,\ ...);}
\DoxyCodeLine{00091\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00092\ \textcolor{keywordtype}{void}\ \_E\_\_sys\_error(\textcolor{keywordtype}{char}\ \textcolor{keyword}{const}\ *fmt,\ ...);}
\DoxyCodeLine{00093\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00094\ \textcolor{keywordtype}{void}\ \_E\_\_fatal\_sys\_error(\textcolor{keywordtype}{char}\ \textcolor{keyword}{const}\ *fmt,\ ...);}
\DoxyCodeLine{00095\ }
\DoxyCodeLine{00102\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00103\ FILE\ *err\_set\_logfp(FILE\ *logfp);}
\DoxyCodeLine{00104\ }
\DoxyCodeLine{00109\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00110\ FILE\ *\ err\_get\_logfp(\textcolor{keywordtype}{void});}
\DoxyCodeLine{00111\ }
\DoxyCodeLine{00112\ }
\DoxyCodeLine{00121\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00122\ \textcolor{keywordtype}{int}\ err\_set\_logfile(\textcolor{keywordtype}{char}\ \textcolor{keyword}{const}\ *file);}
\DoxyCodeLine{00123\ }
\DoxyCodeLine{00127\ \textcolor{preprocessor}{\#define\ E\_FATAL\ \ \_E\_\_pr\_header(\_\_FILE\_\_,\ \_\_LINE\_\_,\ "{}FATAL\_ERROR"{}),\_E\_\_die\_error}}
\DoxyCodeLine{00128\ }
\DoxyCodeLine{00132\ \textcolor{preprocessor}{\#define\ E\_FATAL\_SYSTEM\ \ \_E\_\_pr\_header(\_\_FILE\_\_,\ \_\_LINE\_\_,\ "{}SYSTEM\_ERROR"{}),\_E\_\_fatal\_sys\_error}}
\DoxyCodeLine{00133\ }
\DoxyCodeLine{00137\ \textcolor{preprocessor}{\#define\ E\_WARN\_SYSTEM\ \ \ \_E\_\_pr\_header(\_\_FILE\_\_,\ \_\_LINE\_\_,\ "{}SYSTEM\_ERROR"{}),\_E\_\_sys\_error}}
\DoxyCodeLine{00138\ }
\DoxyCodeLine{00142\ \textcolor{preprocessor}{\#define\ E\_ERROR\_SYSTEM\ \ \_E\_\_pr\_header(\_\_FILE\_\_,\ \_\_LINE\_\_,\ "{}SYSTEM\_ERROR"{}),\_E\_\_sys\_error}}
\DoxyCodeLine{00143\ }
\DoxyCodeLine{00147\ \textcolor{preprocessor}{\#define\ E\_INFO\ \ \ \ \_E\_\_pr\_info\_header(\_\_FILE\_\_,\ \_\_LINE\_\_,\ "{}INFO"{}),\_E\_\_pr\_info}}
\DoxyCodeLine{00148\ }
\DoxyCodeLine{00153\ \textcolor{preprocessor}{\#define\ E\_INFOCONT\ \ \ \ \ \ \ \ \_E\_\_pr\_info}}
\DoxyCodeLine{00154\ }
\DoxyCodeLine{00158\ \textcolor{preprocessor}{\#define\ E\_INFO\_NOFN\ \_E\_\_pr\_info\_header\_wofn("{}INFO"{}),\_E\_\_pr\_info}}
\DoxyCodeLine{00159\ }
\DoxyCodeLine{00160\ }
\DoxyCodeLine{00164\ \textcolor{preprocessor}{\#define\ E\_WARN\ \ \ \ \_E\_\_pr\_header(\_\_FILE\_\_,\ \_\_LINE\_\_,\ "{}WARNING"{}),\_E\_\_pr\_warn}}
\DoxyCodeLine{00165\ }
\DoxyCodeLine{00169\ \textcolor{preprocessor}{\#define\ E\_ERROR\ \ \ \_E\_\_pr\_header(\_\_FILE\_\_,\ \_\_LINE\_\_,\ "{}ERROR"{}),\_E\_\_pr\_warn}}
\DoxyCodeLine{00170\ }
\DoxyCodeLine{00178\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00179\ \textcolor{keywordtype}{int}\ err\_set\_debug\_level(\textcolor{keywordtype}{int}\ level);}
\DoxyCodeLine{00180\ }
\DoxyCodeLine{00186\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00187\ \textcolor{keywordtype}{int}\ err\_get\_debug\_level(\textcolor{keywordtype}{void});}
\DoxyCodeLine{00188\ }
\DoxyCodeLine{00199\ \textcolor{preprocessor}{\#ifdef\ SPHINX\_DEBUG}}
\DoxyCodeLine{00200\ \textcolor{preprocessor}{\#define\ E\_DEBUG(level,x)\ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00201\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ if\ (err\_get\_debug\_level()\ >=\ level)\ \{\ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00202\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ \_E\_\_pr\_header(\_\_FILE\_\_,\ \_\_LINE\_\_,\ "{}DEBUG"{});\ \(\backslash\)}}
\DoxyCodeLine{00203\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ \_E\_\_pr\_info\ x;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00204\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00205\ \textcolor{preprocessor}{\ \ \ \ \}}}
\DoxyCodeLine{00206\ \textcolor{preprocessor}{\#define\ E\_DEBUGCONT(level,x)\ \{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00207\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ if\ (err\_get\_debug\_level()\ >=\ level)\ \{\ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00208\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \ \ \ \ \_E\_\_pr\_info\ x;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00209\ \textcolor{preprocessor}{\ \ \ \ \ \ \ \ \}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(\backslash\)}}
\DoxyCodeLine{00210\ \textcolor{preprocessor}{\ \ \ \ \}}}
\DoxyCodeLine{00211\ \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{00212\ \textcolor{preprocessor}{\#define\ E\_DEBUG(level,x)}}
\DoxyCodeLine{00213\ \textcolor{preprocessor}{\#define\ E\_DEBUGCONT(level,x)}}
\DoxyCodeLine{00214\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00215\ }
\DoxyCodeLine{00216\ \textcolor{preprocessor}{\#ifdef\ \_\_cplusplus}}
\DoxyCodeLine{00217\ \}}
\DoxyCodeLine{00218\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00219\ }
\DoxyCodeLine{00220\ }
\DoxyCodeLine{00221\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{/*\ !\_ERR\_H\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00222\ }
\DoxyCodeLine{00223\ }

\end{DoxyCode}
