\doxysection{glist.\+h}
\label{glist_8h_source}\index{include/sphinxbase/glist.h@{include/sphinxbase/glist.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\ \textcolor{comment}{/*}}
\DoxyCodeLine{00038\ \textcolor{comment}{\ *\ glist.h\ -\/-\/\ Module\ for\ maintaining\ a\ generic,\ linear\ linked-\/list\ structure.}}
\DoxyCodeLine{00039\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00040\ \textcolor{comment}{\ *\ **********************************************}}
\DoxyCodeLine{00041\ \textcolor{comment}{\ *\ CMU\ ARPA\ Speech\ Project}}
\DoxyCodeLine{00042\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00043\ \textcolor{comment}{\ *\ Copyright\ (c)\ 1999\ Carnegie\ Mellon\ University.}}
\DoxyCodeLine{00044\ \textcolor{comment}{\ *\ ALL\ RIGHTS\ RESERVED.}}
\DoxyCodeLine{00045\ \textcolor{comment}{\ *\ **********************************************}}
\DoxyCodeLine{00046\ \textcolor{comment}{\ *\ }}
\DoxyCodeLine{00047\ \textcolor{comment}{\ *\ HISTORY}}
\DoxyCodeLine{00048\ \textcolor{comment}{\ *\ \$Log:\ glist.h,v\ \$}}
\DoxyCodeLine{00049\ \textcolor{comment}{\ *\ Revision\ 1.9\ \ 2005/06/22\ 03:02:51\ \ arthchan2003}}
\DoxyCodeLine{00050\ \textcolor{comment}{\ *\ 1,\ Fixed\ doxygen\ documentation,\ 2,\ add\ \ keyword.}}
\DoxyCodeLine{00051\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00052\ \textcolor{comment}{\ *\ Revision\ 1.4\ \ 2005/05/03\ 04:09:11\ \ archan}}
\DoxyCodeLine{00053\ \textcolor{comment}{\ *\ Implemented\ the\ heart\ of\ word\ copy\ search.\ For\ every\ ci-\/phone,\ every\ word\ end,\ a\ tree\ will\ be\ allocated\ to\ preserve\ its\ pathscore.\ \ This\ is\ different\ from\ 3.5\ or\ below,\ only\ the\ best\ score\ for\ a\ particular\ ci-\/phone,\ regardless\ of\ the\ word-\/ends\ will\ be\ preserved\ at\ every\ frame.\ \ The\ graph\ propagation\ will\ not\ collect\ unused\ word\ tree\ at\ this\ point.\ srch\_WST\_propagate\_wd\_lv2\ is\ also\ as\ the\ most\ stupid\ in\ the\ century.\ \ But\ well,\ after\ all,\ everything\ needs\ a\ start.\ \ I\ will\ then\ really\ get\ the\ results\ from\ the\ search\ and\ see\ how\ it\ looks.}}
\DoxyCodeLine{00054\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00055\ \textcolor{comment}{\ *\ Revision\ 1.3\ \ 2005/03/30\ 01:22:48\ \ archan}}
\DoxyCodeLine{00056\ \textcolor{comment}{\ *\ Fixed\ mistakes\ in\ last\ updates.\ Add}}
\DoxyCodeLine{00057\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00058\ \textcolor{comment}{\ *\ }}
\DoxyCodeLine{00059\ \textcolor{comment}{\ *\ 09-\/Mar-\/1999\ \ M\ K\ Ravishankar\ (rkm@cs.cmu.edu)\ at\ Carnegie\ Mellon\ University}}
\DoxyCodeLine{00060\ \textcolor{comment}{\ *\ \ \ \ \ \ \ \ \ \ \ \ \ \ Added\ glist\_chkdup\_*().}}
\DoxyCodeLine{00061\ \textcolor{comment}{\ *\ }}
\DoxyCodeLine{00062\ \textcolor{comment}{\ *\ 13-\/Feb-\/1999\ \ M\ K\ Ravishankar\ (rkm@cs.cmu.edu)\ at\ Carnegie\ Mellon\ University}}
\DoxyCodeLine{00063\ \textcolor{comment}{\ *\ \ \ \ \ \ \ \ \ \ \ \ \ \ Created\ from\ earlier\ version.}}
\DoxyCodeLine{00064\ \textcolor{comment}{\ */}}
\DoxyCodeLine{00065\ }
\DoxyCodeLine{00066\ }
\DoxyCodeLine{00082\ \textcolor{preprocessor}{\#ifndef\ \_LIBUTIL\_GLIST\_H\_}}
\DoxyCodeLine{00083\ \textcolor{preprocessor}{\#define\ \_LIBUTIL\_GLIST\_H\_}}
\DoxyCodeLine{00084\ }
\DoxyCodeLine{00085\ \textcolor{preprocessor}{\#include\ <stdlib.h>}}
\DoxyCodeLine{00086\ \textcolor{comment}{/*\ Win32/WinCE\ DLL\ gunk\ */}}
\DoxyCodeLine{00087\ \textcolor{preprocessor}{\#include\ <sphinxbase/sphinxbase\_export.h>}}
\DoxyCodeLine{00088\ \textcolor{preprocessor}{\#include\ <sphinxbase/prim\_type.h>}}
\DoxyCodeLine{00089\ }
\DoxyCodeLine{00090\ \textcolor{preprocessor}{\#ifdef\ \_\_cplusplus}}
\DoxyCodeLine{00091\ \textcolor{keyword}{extern}\ \textcolor{stringliteral}{"{}C"{}}\ \{}
\DoxyCodeLine{00092\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00093\ \textcolor{preprocessor}{\#if\ 0}}
\DoxyCodeLine{00094\ \textcolor{comment}{/*\ Fool\ Emacs.\ */}}
\DoxyCodeLine{00095\ \}}
\DoxyCodeLine{00096\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00097\ }
\DoxyCodeLine{00100\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{struct\ }gnode\_s\ \{}
\DoxyCodeLine{00101\ \ \ \ \ \ \ \ \ anytype\_t\ data;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ }
\DoxyCodeLine{00102\ \ \ \ \ \ \ \ \ \textcolor{keyword}{struct\ }gnode\_s\ *next;\ \ \ \ \ \ \ \ }
\DoxyCodeLine{00103\ \}\ gnode\_t;}
\DoxyCodeLine{00104\ \textcolor{keyword}{typedef}\ gnode\_t\ *glist\_t;\ }
\DoxyCodeLine{00109\ \textcolor{preprocessor}{\#define\ gnode\_ptr(g)\ \ \ \ \ \ \ \ \ \ \ \ ((g)-\/>data.ptr)}}
\DoxyCodeLine{00110\ \textcolor{preprocessor}{\#define\ gnode\_int32(g)\ \ \ \ \ \ \ \ \ \ ((g)-\/>data.i)}}
\DoxyCodeLine{00111\ \textcolor{preprocessor}{\#define\ gnode\_uint32(g)\ \ \ \ \ \ \ \ \ ((g)-\/>data.ui)}}
\DoxyCodeLine{00112\ \textcolor{preprocessor}{\#define\ gnode\_float32(g)\ \ \ \ \ \ \ \ ((float32)(g)-\/>data.fl)}}
\DoxyCodeLine{00113\ \textcolor{preprocessor}{\#define\ gnode\_float64(g)\ \ \ \ \ \ \ \ ((g)-\/>data.fl)}}
\DoxyCodeLine{00114\ \textcolor{preprocessor}{\#define\ gnode\_next(g)\ \ \ \ \ \ \ \ \ \ \ ((g)-\/>next)}}
\DoxyCodeLine{00115\ }
\DoxyCodeLine{00116\ }
\DoxyCodeLine{00122\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00123\ glist\_t\ glist\_add\_ptr\ (glist\_t\ g,\ \ }
\DoxyCodeLine{00124\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{void}\ *ptr\ \ \ }
\DoxyCodeLine{00125\ \ \ \ \ \ \ \ \ );}
\DoxyCodeLine{00126\ }
\DoxyCodeLine{00130\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00131\ glist\_t\ glist\_add\_int32\ (glist\_t\ g,\ }
\DoxyCodeLine{00132\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ int32\ val\ \ }
\DoxyCodeLine{00133\ \ \ \ \ \ \ \ \ );}
\DoxyCodeLine{00137\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00138\ glist\_t\ glist\_add\_uint32\ (glist\_t\ g,\ \ }
\DoxyCodeLine{00139\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ uint32\ val\ \ }
\DoxyCodeLine{00140\ \ \ \ \ \ \ \ \ );}
\DoxyCodeLine{00144\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00145\ glist\_t\ glist\_add\_float32\ (glist\_t\ g,\ }
\DoxyCodeLine{00146\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ float32\ val\ }
\DoxyCodeLine{00147\ \ \ \ \ \ \ \ \ );}
\DoxyCodeLine{00151\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00152\ glist\_t\ glist\_add\_float64\ (glist\_t\ g,\ }
\DoxyCodeLine{00153\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ float64\ val\ \ }
\DoxyCodeLine{00154\ \ \ \ \ \ \ \ \ );}
\DoxyCodeLine{00155\ }
\DoxyCodeLine{00156\ }
\DoxyCodeLine{00157\ }
\DoxyCodeLine{00163\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00164\ gnode\_t\ *glist\_insert\_ptr\ (gnode\_t\ *gn,\ }
\DoxyCodeLine{00165\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{void}\ *ptr\ }
\DoxyCodeLine{00166\ \ \ \ \ \ \ \ \ );}
\DoxyCodeLine{00170\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00171\ gnode\_t\ *glist\_insert\_int32\ (gnode\_t\ *gn,\ }
\DoxyCodeLine{00172\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ int32\ val\ }
\DoxyCodeLine{00173\ \ \ \ \ \ \ \ \ );}
\DoxyCodeLine{00177\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00178\ gnode\_t\ *glist\_insert\_uint32\ (gnode\_t\ *gn,\ }
\DoxyCodeLine{00179\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ uint32\ val\ }
\DoxyCodeLine{00180\ \ \ \ \ \ \ \ \ );}
\DoxyCodeLine{00184\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00185\ gnode\_t\ *glist\_insert\_float32\ (gnode\_t\ *gn,\ }
\DoxyCodeLine{00186\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ float32\ val\ }
\DoxyCodeLine{00187\ \ \ \ \ \ \ \ \ );}
\DoxyCodeLine{00191\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00192\ gnode\_t\ *glist\_insert\_float64\ (gnode\_t\ *gn,\ }
\DoxyCodeLine{00193\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ float64\ val\ }
\DoxyCodeLine{00194\ \ \ \ \ \ \ \ \ );}
\DoxyCodeLine{00195\ }
\DoxyCodeLine{00202\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00203\ glist\_t\ glist\_reverse\ (glist\_t\ g\ }
\DoxyCodeLine{00204\ \ \ \ \ \ \ \ \ );}
\DoxyCodeLine{00205\ }
\DoxyCodeLine{00206\ }
\DoxyCodeLine{00211\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00212\ int32\ glist\_count\ (glist\_t\ g\ }
\DoxyCodeLine{00213\ \ \ \ \ \ \ \ \ );}
\DoxyCodeLine{00214\ }
\DoxyCodeLine{00219\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00220\ \textcolor{keywordtype}{void}\ glist\_free\ (glist\_t\ g);}
\DoxyCodeLine{00221\ }
\DoxyCodeLine{00222\ }
\DoxyCodeLine{00227\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00228\ gnode\_t\ *gnode\_free(gnode\_t\ *gn,\ }
\DoxyCodeLine{00229\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ gnode\_t\ *pred}
\DoxyCodeLine{00230\ \ \ \ \ \ \ \ \ );}
\DoxyCodeLine{00231\ }
\DoxyCodeLine{00235\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00236\ gnode\_t\ *glist\_tail\ (glist\_t\ g);}
\DoxyCodeLine{00237\ }
\DoxyCodeLine{00238\ \textcolor{preprocessor}{\#ifdef\ \_\_cplusplus}}
\DoxyCodeLine{00239\ \}}
\DoxyCodeLine{00240\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00241\ }
\DoxyCodeLine{00242\ \textcolor{preprocessor}{\#endif}}

\end{DoxyCode}
