\doxysection{glist.\+c}
\label{glist_8c_source}\index{src/libsphinxbase/util/glist.c@{src/libsphinxbase/util/glist.c}}

\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.c,v\ \$}}
\DoxyCodeLine{00049\ \textcolor{comment}{\ *\ Revision\ 1.8\ \ 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.3\ \ 2005/03/30\ 01:22:48\ \ archan}}
\DoxyCodeLine{00053\ \textcolor{comment}{\ *\ Fixed\ mistakes\ in\ last\ updates.\ Add}}
\DoxyCodeLine{00054\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00055\ \textcolor{comment}{\ *\ }}
\DoxyCodeLine{00056\ \textcolor{comment}{\ *\ 09-\/Mar-\/1999\ \ M\ K\ Ravishankar\ (rkm@cs.cmu.edu)\ at\ Carnegie\ Mellon\ University}}
\DoxyCodeLine{00057\ \textcolor{comment}{\ *\ \ \ \ \ \ \ \ \ \ \ \ \ \ Added\ glist\_chkdup\_*().}}
\DoxyCodeLine{00058\ \textcolor{comment}{\ *\ }}
\DoxyCodeLine{00059\ \textcolor{comment}{\ *\ 13-\/Feb-\/1999\ \ M\ K\ Ravishankar\ (rkm@cs.cmu.edu)\ at\ Carnegie\ Mellon\ University}}
\DoxyCodeLine{00060\ \textcolor{comment}{\ *\ \ \ \ \ \ \ \ \ \ \ \ \ \ Created\ from\ earlier\ version.}}
\DoxyCodeLine{00061\ \textcolor{comment}{\ */}}
\DoxyCodeLine{00062\ }
\DoxyCodeLine{00063\ }
\DoxyCodeLine{00064\ \textcolor{preprocessor}{\#include\ <stdio.h>}}
\DoxyCodeLine{00065\ \textcolor{preprocessor}{\#include\ <stdlib.h>}}
\DoxyCodeLine{00066\ \textcolor{preprocessor}{\#include\ <string.h>}}
\DoxyCodeLine{00067\ \textcolor{preprocessor}{\#include\ <assert.h>}}
\DoxyCodeLine{00068\ }
\DoxyCodeLine{00069\ \textcolor{preprocessor}{\#include\ "{}sphinxbase/glist.h"{}}}
\DoxyCodeLine{00070\ \textcolor{preprocessor}{\#include\ "{}sphinxbase/ckd\_alloc.h"{}}}
\DoxyCodeLine{00071\ }
\DoxyCodeLine{00072\ }
\DoxyCodeLine{00073\ glist\_t}
\DoxyCodeLine{00074\ glist\_add\_ptr(glist\_t\ g,\ \textcolor{keywordtype}{void}\ *ptr)}
\DoxyCodeLine{00075\ \{}
\DoxyCodeLine{00076\ \ \ \ \ gnode\_t\ *gn;}
\DoxyCodeLine{00077\ }
\DoxyCodeLine{00078\ \ \ \ \ gn\ =\ (gnode\_t\ *)\ ckd\_calloc(1,\ \textcolor{keyword}{sizeof}(gnode\_t));}
\DoxyCodeLine{00079\ \ \ \ \ gn-\/>data.ptr\ =\ ptr;}
\DoxyCodeLine{00080\ \ \ \ \ gn-\/>next\ =\ g;}
\DoxyCodeLine{00081\ \ \ \ \ \textcolor{keywordflow}{return}\ ((glist\_t)\ gn);\ \ \ \ \ \ \textcolor{comment}{/*\ Return\ the\ new\ head\ of\ the\ list\ */}}
\DoxyCodeLine{00082\ \}}
\DoxyCodeLine{00083\ }
\DoxyCodeLine{00084\ }
\DoxyCodeLine{00085\ glist\_t}
\DoxyCodeLine{00086\ glist\_add\_int32(glist\_t\ g,\ int32\ val)}
\DoxyCodeLine{00087\ \{}
\DoxyCodeLine{00088\ \ \ \ \ gnode\_t\ *gn;}
\DoxyCodeLine{00089\ }
\DoxyCodeLine{00090\ \ \ \ \ gn\ =\ (gnode\_t\ *)\ ckd\_calloc(1,\ \textcolor{keyword}{sizeof}(gnode\_t));}
\DoxyCodeLine{00091\ \ \ \ \ gn-\/>data.i\ =\ (long)val;}
\DoxyCodeLine{00092\ \ \ \ \ gn-\/>next\ =\ g;}
\DoxyCodeLine{00093\ \ \ \ \ \textcolor{keywordflow}{return}\ ((glist\_t)\ gn);\ \ \ \ \ \ \textcolor{comment}{/*\ Return\ the\ new\ head\ of\ the\ list\ */}}
\DoxyCodeLine{00094\ \}}
\DoxyCodeLine{00095\ }
\DoxyCodeLine{00096\ }
\DoxyCodeLine{00097\ glist\_t}
\DoxyCodeLine{00098\ glist\_add\_uint32(glist\_t\ g,\ uint32\ val)}
\DoxyCodeLine{00099\ \{}
\DoxyCodeLine{00100\ \ \ \ \ gnode\_t\ *gn;}
\DoxyCodeLine{00101\ }
\DoxyCodeLine{00102\ \ \ \ \ gn\ =\ (gnode\_t\ *)\ ckd\_calloc(1,\ \textcolor{keyword}{sizeof}(gnode\_t));}
\DoxyCodeLine{00103\ \ \ \ \ gn-\/>data.ui\ =\ (\textcolor{keywordtype}{unsigned}\ long)val;}
\DoxyCodeLine{00104\ \ \ \ \ gn-\/>next\ =\ g;}
\DoxyCodeLine{00105\ \ \ \ \ \textcolor{keywordflow}{return}\ ((glist\_t)\ gn);\ \ \ \ \ \ \textcolor{comment}{/*\ Return\ the\ new\ head\ of\ the\ list\ */}}
\DoxyCodeLine{00106\ \}}
\DoxyCodeLine{00107\ }
\DoxyCodeLine{00108\ }
\DoxyCodeLine{00109\ glist\_t}
\DoxyCodeLine{00110\ glist\_add\_float32(glist\_t\ g,\ float32\ val)}
\DoxyCodeLine{00111\ \{}
\DoxyCodeLine{00112\ \ \ \ \ gnode\_t\ *gn;}
\DoxyCodeLine{00113\ }
\DoxyCodeLine{00114\ \ \ \ \ gn\ =\ (gnode\_t\ *)\ ckd\_calloc(1,\ \textcolor{keyword}{sizeof}(gnode\_t));}
\DoxyCodeLine{00115\ \ \ \ \ gn-\/>data.fl\ =\ (double)val;}
\DoxyCodeLine{00116\ \ \ \ \ gn-\/>next\ =\ g;}
\DoxyCodeLine{00117\ \ \ \ \ \textcolor{keywordflow}{return}\ ((glist\_t)\ gn);\ \ \ \ \ \ \textcolor{comment}{/*\ Return\ the\ new\ head\ of\ the\ list\ */}}
\DoxyCodeLine{00118\ \}}
\DoxyCodeLine{00119\ }
\DoxyCodeLine{00120\ }
\DoxyCodeLine{00121\ glist\_t}
\DoxyCodeLine{00122\ glist\_add\_float64(glist\_t\ g,\ float64\ val)}
\DoxyCodeLine{00123\ \{}
\DoxyCodeLine{00124\ \ \ \ \ gnode\_t\ *gn;}
\DoxyCodeLine{00125\ }
\DoxyCodeLine{00126\ \ \ \ \ gn\ =\ (gnode\_t\ *)\ ckd\_calloc(1,\ \textcolor{keyword}{sizeof}(gnode\_t));}
\DoxyCodeLine{00127\ \ \ \ \ gn-\/>data.fl\ =\ (double)val;}
\DoxyCodeLine{00128\ \ \ \ \ gn-\/>next\ =\ g;}
\DoxyCodeLine{00129\ \ \ \ \ \textcolor{keywordflow}{return}\ ((glist\_t)\ gn);\ \ \ \ \ \ \textcolor{comment}{/*\ Return\ the\ new\ head\ of\ the\ list\ */}}
\DoxyCodeLine{00130\ \}}
\DoxyCodeLine{00131\ }
\DoxyCodeLine{00132\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{00133\ glist\_free(glist\_t\ g)}
\DoxyCodeLine{00134\ \{}
\DoxyCodeLine{00135\ \ \ \ \ gnode\_t\ *gn;}
\DoxyCodeLine{00136\ }
\DoxyCodeLine{00137\ \ \ \ \ \textcolor{keywordflow}{while}\ (g)\ \{}
\DoxyCodeLine{00138\ \ \ \ \ \ \ \ \ gn\ =\ g;}
\DoxyCodeLine{00139\ \ \ \ \ \ \ \ \ g\ =\ gn-\/>next;}
\DoxyCodeLine{00140\ \ \ \ \ \ \ \ \ ckd\_free((\textcolor{keywordtype}{void}\ *)\ gn);}
\DoxyCodeLine{00141\ \ \ \ \ \}}
\DoxyCodeLine{00142\ \}}
\DoxyCodeLine{00143\ }
\DoxyCodeLine{00144\ int32}
\DoxyCodeLine{00145\ glist\_count(glist\_t\ g)}
\DoxyCodeLine{00146\ \{}
\DoxyCodeLine{00147\ \ \ \ \ gnode\_t\ *gn;}
\DoxyCodeLine{00148\ \ \ \ \ int32\ n;}
\DoxyCodeLine{00149\ }
\DoxyCodeLine{00150\ \ \ \ \ \textcolor{keywordflow}{for}\ (gn\ =\ g,\ n\ =\ 0;\ gn;\ gn\ =\ gn-\/>next,\ n++);}
\DoxyCodeLine{00151\ \ \ \ \ \textcolor{keywordflow}{return}\ n;}
\DoxyCodeLine{00152\ \}}
\DoxyCodeLine{00153\ }
\DoxyCodeLine{00154\ }
\DoxyCodeLine{00155\ gnode\_t\ *}
\DoxyCodeLine{00156\ glist\_tail(glist\_t\ g)}
\DoxyCodeLine{00157\ \{}
\DoxyCodeLine{00158\ \ \ \ \ gnode\_t\ *gn;}
\DoxyCodeLine{00159\ }
\DoxyCodeLine{00160\ \ \ \ \ \textcolor{keywordflow}{if}\ (!g)}
\DoxyCodeLine{00161\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ NULL;}
\DoxyCodeLine{00162\ }
\DoxyCodeLine{00163\ \ \ \ \ \textcolor{keywordflow}{for}\ (gn\ =\ g;\ gn-\/>next;\ gn\ =\ gn-\/>next);}
\DoxyCodeLine{00164\ \ \ \ \ \textcolor{keywordflow}{return}\ gn;}
\DoxyCodeLine{00165\ \}}
\DoxyCodeLine{00166\ }
\DoxyCodeLine{00167\ }
\DoxyCodeLine{00168\ glist\_t}
\DoxyCodeLine{00169\ glist\_reverse(glist\_t\ g)}
\DoxyCodeLine{00170\ \{}
\DoxyCodeLine{00171\ \ \ \ \ gnode\_t\ *gn,\ *nextgn;}
\DoxyCodeLine{00172\ \ \ \ \ gnode\_t\ *rev;}
\DoxyCodeLine{00173\ }
\DoxyCodeLine{00174\ \ \ \ \ rev\ =\ NULL;}
\DoxyCodeLine{00175\ \ \ \ \ \textcolor{keywordflow}{for}\ (gn\ =\ g;\ gn;\ gn\ =\ nextgn)\ \{}
\DoxyCodeLine{00176\ \ \ \ \ \ \ \ \ nextgn\ =\ gn-\/>next;}
\DoxyCodeLine{00177\ }
\DoxyCodeLine{00178\ \ \ \ \ \ \ \ \ gn-\/>next\ =\ rev;}
\DoxyCodeLine{00179\ \ \ \ \ \ \ \ \ rev\ =\ gn;}
\DoxyCodeLine{00180\ \ \ \ \ \}}
\DoxyCodeLine{00181\ }
\DoxyCodeLine{00182\ \ \ \ \ \textcolor{keywordflow}{return}\ rev;}
\DoxyCodeLine{00183\ \}}
\DoxyCodeLine{00184\ }
\DoxyCodeLine{00185\ }
\DoxyCodeLine{00186\ gnode\_t\ *}
\DoxyCodeLine{00187\ glist\_insert\_ptr(gnode\_t\ *\ gn,\ \textcolor{keywordtype}{void}\ *ptr)}
\DoxyCodeLine{00188\ \{}
\DoxyCodeLine{00189\ \ \ \ \ gnode\_t\ *newgn;}
\DoxyCodeLine{00190\ }
\DoxyCodeLine{00191\ \ \ \ \ newgn\ =\ (gnode\_t\ *)\ ckd\_calloc(1,\ \textcolor{keyword}{sizeof}(gnode\_t));}
\DoxyCodeLine{00192\ \ \ \ \ newgn-\/>data.ptr\ =\ ptr;}
\DoxyCodeLine{00193\ \ \ \ \ newgn-\/>next\ =\ gn-\/>next;}
\DoxyCodeLine{00194\ \ \ \ \ gn-\/>next\ =\ newgn;}
\DoxyCodeLine{00195\ }
\DoxyCodeLine{00196\ \ \ \ \ \textcolor{keywordflow}{return}\ newgn;}
\DoxyCodeLine{00197\ \}}
\DoxyCodeLine{00198\ }
\DoxyCodeLine{00199\ }
\DoxyCodeLine{00200\ gnode\_t\ *}
\DoxyCodeLine{00201\ glist\_insert\_int32(gnode\_t\ *\ gn,\ int32\ val)}
\DoxyCodeLine{00202\ \{}
\DoxyCodeLine{00203\ \ \ \ \ gnode\_t\ *newgn;}
\DoxyCodeLine{00204\ }
\DoxyCodeLine{00205\ \ \ \ \ newgn\ =\ (gnode\_t\ *)\ ckd\_calloc(1,\ \textcolor{keyword}{sizeof}(gnode\_t));}
\DoxyCodeLine{00206\ \ \ \ \ newgn-\/>data.i\ =\ val;}
\DoxyCodeLine{00207\ \ \ \ \ newgn-\/>next\ =\ gn-\/>next;}
\DoxyCodeLine{00208\ \ \ \ \ gn-\/>next\ =\ newgn;}
\DoxyCodeLine{00209\ }
\DoxyCodeLine{00210\ \ \ \ \ \textcolor{keywordflow}{return}\ newgn;}
\DoxyCodeLine{00211\ \}}
\DoxyCodeLine{00212\ }
\DoxyCodeLine{00213\ }
\DoxyCodeLine{00214\ gnode\_t\ *}
\DoxyCodeLine{00215\ glist\_insert\_uint32(gnode\_t\ *\ gn,\ uint32\ val)}
\DoxyCodeLine{00216\ \{}
\DoxyCodeLine{00217\ \ \ \ \ gnode\_t\ *newgn;}
\DoxyCodeLine{00218\ }
\DoxyCodeLine{00219\ \ \ \ \ newgn\ =\ (gnode\_t\ *)\ ckd\_calloc(1,\ \textcolor{keyword}{sizeof}(gnode\_t));}
\DoxyCodeLine{00220\ \ \ \ \ newgn-\/>data.ui\ =\ val;}
\DoxyCodeLine{00221\ \ \ \ \ newgn-\/>next\ =\ gn-\/>next;}
\DoxyCodeLine{00222\ }
\DoxyCodeLine{00223\ \ \ \ \ gn-\/>next\ =\ newgn;}
\DoxyCodeLine{00224\ }
\DoxyCodeLine{00225\ \ \ \ \ \textcolor{keywordflow}{return}\ newgn;}
\DoxyCodeLine{00226\ \}}
\DoxyCodeLine{00227\ }
\DoxyCodeLine{00228\ }
\DoxyCodeLine{00229\ gnode\_t\ *}
\DoxyCodeLine{00230\ glist\_insert\_float32(gnode\_t\ *\ gn,\ float32\ val)}
\DoxyCodeLine{00231\ \{}
\DoxyCodeLine{00232\ \ \ \ \ gnode\_t\ *newgn;}
\DoxyCodeLine{00233\ }
\DoxyCodeLine{00234\ \ \ \ \ newgn\ =\ (gnode\_t\ *)\ ckd\_calloc(1,\ \textcolor{keyword}{sizeof}(gnode\_t));}
\DoxyCodeLine{00235\ \ \ \ \ newgn-\/>data.fl\ =\ (double)val;}
\DoxyCodeLine{00236\ \ \ \ \ newgn-\/>next\ =\ gn-\/>next;}
\DoxyCodeLine{00237\ \ \ \ \ gn-\/>next\ =\ newgn;}
\DoxyCodeLine{00238\ }
\DoxyCodeLine{00239\ \ \ \ \ \textcolor{keywordflow}{return}\ newgn;}
\DoxyCodeLine{00240\ \}}
\DoxyCodeLine{00241\ }
\DoxyCodeLine{00242\ }
\DoxyCodeLine{00243\ gnode\_t\ *}
\DoxyCodeLine{00244\ glist\_insert\_float64(gnode\_t\ *\ gn,\ float64\ val)}
\DoxyCodeLine{00245\ \{}
\DoxyCodeLine{00246\ \ \ \ \ gnode\_t\ *newgn;}
\DoxyCodeLine{00247\ }
\DoxyCodeLine{00248\ \ \ \ \ newgn\ =\ (gnode\_t\ *)\ ckd\_calloc(1,\ \textcolor{keyword}{sizeof}(gnode\_t));}
\DoxyCodeLine{00249\ \ \ \ \ newgn-\/>data.fl\ =\ (double)val;}
\DoxyCodeLine{00250\ \ \ \ \ newgn-\/>next\ =\ gn-\/>next;}
\DoxyCodeLine{00251\ \ \ \ \ gn-\/>next\ =\ newgn;}
\DoxyCodeLine{00252\ }
\DoxyCodeLine{00253\ \ \ \ \ \textcolor{keywordflow}{return}\ newgn;}
\DoxyCodeLine{00254\ \}}
\DoxyCodeLine{00255\ }
\DoxyCodeLine{00256\ gnode\_t\ *}
\DoxyCodeLine{00257\ gnode\_free(gnode\_t\ *\ gn,\ gnode\_t\ *\ pred)}
\DoxyCodeLine{00258\ \{}
\DoxyCodeLine{00259\ \ \ \ \ gnode\_t\ *next;}
\DoxyCodeLine{00260\ }
\DoxyCodeLine{00261\ \ \ \ \ next\ =\ gn-\/>next;}
\DoxyCodeLine{00262\ \ \ \ \ \textcolor{keywordflow}{if}\ (pred)\ \{}
\DoxyCodeLine{00263\ \ \ \ \ \ \ \ \ assert(pred-\/>next\ ==\ gn);}
\DoxyCodeLine{00264\ }
\DoxyCodeLine{00265\ \ \ \ \ \ \ \ \ pred-\/>next\ =\ next;}
\DoxyCodeLine{00266\ \ \ \ \ \}}
\DoxyCodeLine{00267\ }
\DoxyCodeLine{00268\ \ \ \ \ ckd\_free((\textcolor{keywordtype}{char}\ *)\ gn);}
\DoxyCodeLine{00269\ }
\DoxyCodeLine{00270\ \ \ \ \ \textcolor{keywordflow}{return}\ next;}
\DoxyCodeLine{00271\ \}}

\end{DoxyCode}
