\section{include/sphinxbase/glist.h File Reference}
\label{glist_8h}\index{include/sphinxbase/glist.\+h@{include/sphinxbase/glist.\+h}}


Generic linked-\/lists maintenance.  


{\ttfamily \#include $<$stdlib.\+h$>$}\\*
{\ttfamily \#include $<$sphinxbase/sphinxbase\+\_\+export.\+h$>$}\\*
{\ttfamily \#include $<$sphinxbase/prim\+\_\+type.\+h$>$}\\*
\subsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct {\bf gnode\+\_\+s}
\begin{DoxyCompactList}\small\item\em A node in a generic list. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define {\bf gnode\+\_\+ptr}(g)~((g)-\/$>$data.\+ptr)
\begin{DoxyCompactList}\small\item\em Head of a list of gnodes. \end{DoxyCompactList}\item 
\#define {\bfseries gnode\+\_\+int32}(g)~((g)-\/$>$data.\+i)\label{glist_8h_a7daab0205c40d1b449529ee4cc54522b}

\item 
\#define {\bfseries gnode\+\_\+uint32}(g)~((g)-\/$>$data.\+ui)\label{glist_8h_a3af0cc8d5d612e85fa433ac3edf42fd6}

\item 
\#define {\bfseries gnode\+\_\+float32}(g)~((float32)(g)-\/$>$data.\+fl)\label{glist_8h_aaf6a2bdc69642303426c20fc0bdfa5f6}

\item 
\#define {\bfseries gnode\+\_\+float64}(g)~((g)-\/$>$data.\+fl)\label{glist_8h_abfea8eee77afc1e3046ef33ae6c0f5b4}

\item 
\#define {\bfseries gnode\+\_\+next}(g)~((g)-\/$>$next)\label{glist_8h_a33fc794db097ba2a5a36eba12c418993}

\end{DoxyCompactItemize}
\subsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
typedef struct {\bf gnode\+\_\+s} {\bf gnode\+\_\+t}\label{glist_8h_a35eee566c2974c9a3e3055daf1611793}

\begin{DoxyCompactList}\small\item\em A node in a generic list. \end{DoxyCompactList}\item 
typedef {\bf gnode\+\_\+t} $\ast$ {\bfseries glist\+\_\+t}\label{glist_8h_a576a9ce77a5af8b912e75b32bce607f2}

\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T {\bf glist\+\_\+t} {\bf glist\+\_\+add\+\_\+ptr} ({\bf glist\+\_\+t} g, void $\ast$ptr)
\begin{DoxyCompactList}\small\item\em Create and prepend a new list node, with the given user-\/defined data, at the H\+E\+A\+D of the given generic list. \end{DoxyCompactList}\item 
S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T {\bf glist\+\_\+t} {\bf glist\+\_\+add\+\_\+int32} ({\bf glist\+\_\+t} g, int32 val)
\begin{DoxyCompactList}\small\item\em Create and prepend a new list node containing an integer. \end{DoxyCompactList}\item 
S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T {\bf glist\+\_\+t} {\bf glist\+\_\+add\+\_\+uint32} ({\bf glist\+\_\+t} g, uint32 val)
\begin{DoxyCompactList}\small\item\em Create and prepend a new list node containing an unsigned integer. \end{DoxyCompactList}\item 
S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T {\bf glist\+\_\+t} {\bf glist\+\_\+add\+\_\+float32} ({\bf glist\+\_\+t} g, float32 val)
\begin{DoxyCompactList}\small\item\em Create and prepend a new list node containing a single-\/precision float. \end{DoxyCompactList}\item 
S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T {\bf glist\+\_\+t} {\bf glist\+\_\+add\+\_\+float64} ({\bf glist\+\_\+t} g, float64 val)
\begin{DoxyCompactList}\small\item\em Create and prepend a new list node containing a double-\/precision float. \end{DoxyCompactList}\item 
S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T {\bf gnode\+\_\+t} $\ast$ {\bf glist\+\_\+insert\+\_\+ptr} ({\bf gnode\+\_\+t} $\ast$gn, void $\ast$ptr)
\begin{DoxyCompactList}\small\item\em Create and insert a new list node, with the given user-\/defined data, after the given generic node gn. \end{DoxyCompactList}\item 
S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T {\bf gnode\+\_\+t} $\ast$ {\bf glist\+\_\+insert\+\_\+int32} ({\bf gnode\+\_\+t} $\ast$gn, int32 val)
\begin{DoxyCompactList}\small\item\em Create and insert a new list node containing an integer. \end{DoxyCompactList}\item 
S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T {\bf gnode\+\_\+t} $\ast$ {\bf glist\+\_\+insert\+\_\+uint32} ({\bf gnode\+\_\+t} $\ast$gn, uint32 val)
\begin{DoxyCompactList}\small\item\em Create and insert a new list node containing an unsigned integer. \end{DoxyCompactList}\item 
S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T {\bf gnode\+\_\+t} $\ast$ {\bf glist\+\_\+insert\+\_\+float32} ({\bf gnode\+\_\+t} $\ast$gn, float32 val)
\begin{DoxyCompactList}\small\item\em Create and insert a new list node containing a single-\/precision float. \end{DoxyCompactList}\item 
S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T {\bf gnode\+\_\+t} $\ast$ {\bf glist\+\_\+insert\+\_\+float64} ({\bf gnode\+\_\+t} $\ast$gn, float64 val)
\begin{DoxyCompactList}\small\item\em Create and insert a new list node containing a double-\/precision float. \end{DoxyCompactList}\item 
S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T {\bf glist\+\_\+t} {\bf glist\+\_\+reverse} ({\bf glist\+\_\+t} g)
\begin{DoxyCompactList}\small\item\em Reverse the order of the given glist. \end{DoxyCompactList}\item 
S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T int32 {\bf glist\+\_\+count} ({\bf glist\+\_\+t} g)
\begin{DoxyCompactList}\small\item\em Count the number of element in a given link list. \end{DoxyCompactList}\item 
S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T void {\bf glist\+\_\+free} ({\bf glist\+\_\+t} g)
\begin{DoxyCompactList}\small\item\em Free the given generic list; user-\/defined data contained within is not automatically freed. \end{DoxyCompactList}\item 
S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T {\bf gnode\+\_\+t} $\ast$ {\bf gnode\+\_\+free} ({\bf gnode\+\_\+t} $\ast$gn, {\bf gnode\+\_\+t} $\ast$pred)
\begin{DoxyCompactList}\small\item\em Free the given node, gn, of a glist, pred being its predecessor in the list. \end{DoxyCompactList}\item 
S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T {\bf gnode\+\_\+t} $\ast$ {\bf glist\+\_\+tail} ({\bf glist\+\_\+t} g)\label{glist_8h_a6921d6b8b11cb9e05fadeaa091e89234}

\begin{DoxyCompactList}\small\item\em Return the last node in the given list. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Generic linked-\/lists maintenance. 

Only insert at the head of the list. A convenient little linked-\/list package, but a double-\/edged sword\+: the user must keep track of the data type within the linked list elements. When it was first written, there was no selective deletions except to destroy the entire list. This is modified in later version.

(C++ would be good for this, but that's a double-\/edged sword as well.) 

Definition in file {\bf glist.\+h}.



\subsection{Macro Definition Documentation}
\index{glist.\+h@{glist.\+h}!gnode\+\_\+ptr@{gnode\+\_\+ptr}}
\index{gnode\+\_\+ptr@{gnode\+\_\+ptr}!glist.\+h@{glist.\+h}}
\subsubsection[{gnode\+\_\+ptr}]{\setlength{\rightskip}{0pt plus 5cm}\#define gnode\+\_\+ptr(
\begin{DoxyParamCaption}
\item[{}]{g}
\end{DoxyParamCaption}
)~((g)-\/$>$data.\+ptr)}\label{glist_8h_ace56682f14d84cc456c805d26fd86734}


Head of a list of gnodes. 

Access macros, for convenience 

Definition at line 109 of file glist.\+h.



Referenced by cmd\+\_\+ln\+\_\+free\+\_\+r(), jsgf\+\_\+grammar\+\_\+free(), listelem\+\_\+alloc\+\_\+free(), listelem\+\_\+get\+\_\+item(), listelem\+\_\+stats(), ngram\+\_\+model\+\_\+read\+\_\+classdef(), ngram\+\_\+model\+\_\+set\+\_\+read(), and parse\+\_\+subvecs().



\subsection{Function Documentation}
\index{glist.\+h@{glist.\+h}!glist\+\_\+add\+\_\+float32@{glist\+\_\+add\+\_\+float32}}
\index{glist\+\_\+add\+\_\+float32@{glist\+\_\+add\+\_\+float32}!glist.\+h@{glist.\+h}}
\subsubsection[{glist\+\_\+add\+\_\+float32}]{\setlength{\rightskip}{0pt plus 5cm}S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T {\bf glist\+\_\+t} glist\+\_\+add\+\_\+float32 (
\begin{DoxyParamCaption}
\item[{{\bf glist\+\_\+t}}]{g, }
\item[{float32}]{val}
\end{DoxyParamCaption}
)}\label{glist_8h_a4fc4db2fbebd7b659554227d411f6737}


Create and prepend a new list node containing a single-\/precision float. 


\begin{DoxyParams}{Parameters}
{\em g} & a link list \\
\hline
{\em val} & a float32 vlaue \\
\hline
\end{DoxyParams}


Definition at line 110 of file glist.\+c.



References ckd\+\_\+calloc, and gnode\+\_\+s\+::next.



Referenced by ngram\+\_\+model\+\_\+add\+\_\+class().

\index{glist.\+h@{glist.\+h}!glist\+\_\+add\+\_\+float64@{glist\+\_\+add\+\_\+float64}}
\index{glist\+\_\+add\+\_\+float64@{glist\+\_\+add\+\_\+float64}!glist.\+h@{glist.\+h}}
\subsubsection[{glist\+\_\+add\+\_\+float64}]{\setlength{\rightskip}{0pt plus 5cm}S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T {\bf glist\+\_\+t} glist\+\_\+add\+\_\+float64 (
\begin{DoxyParamCaption}
\item[{{\bf glist\+\_\+t}}]{g, }
\item[{float64}]{val}
\end{DoxyParamCaption}
)}\label{glist_8h_a5bdd11639ef5846abb7ceb6caf059f4e}


Create and prepend a new list node containing a double-\/precision float. 


\begin{DoxyParams}{Parameters}
{\em g} & a link list \\
\hline
{\em val} & a float64 vlaue \\
\hline
\end{DoxyParams}


Definition at line 122 of file glist.\+c.



References ckd\+\_\+calloc, and gnode\+\_\+s\+::next.

\index{glist.\+h@{glist.\+h}!glist\+\_\+add\+\_\+int32@{glist\+\_\+add\+\_\+int32}}
\index{glist\+\_\+add\+\_\+int32@{glist\+\_\+add\+\_\+int32}!glist.\+h@{glist.\+h}}
\subsubsection[{glist\+\_\+add\+\_\+int32}]{\setlength{\rightskip}{0pt plus 5cm}S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T {\bf glist\+\_\+t} glist\+\_\+add\+\_\+int32 (
\begin{DoxyParamCaption}
\item[{{\bf glist\+\_\+t}}]{g, }
\item[{int32}]{val}
\end{DoxyParamCaption}
)}\label{glist_8h_a28adfcc24a784aaed1a0b3c4c4de4c42}


Create and prepend a new list node containing an integer. 


\begin{DoxyParams}{Parameters}
{\em g} & a link list \\
\hline
{\em val} & an integer value \\
\hline
\end{DoxyParams}


Definition at line 86 of file glist.\+c.



References ckd\+\_\+calloc, and gnode\+\_\+s\+::next.



Referenced by parse\+\_\+subvecs().

\index{glist.\+h@{glist.\+h}!glist\+\_\+add\+\_\+ptr@{glist\+\_\+add\+\_\+ptr}}
\index{glist\+\_\+add\+\_\+ptr@{glist\+\_\+add\+\_\+ptr}!glist.\+h@{glist.\+h}}
\subsubsection[{glist\+\_\+add\+\_\+ptr}]{\setlength{\rightskip}{0pt plus 5cm}S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T {\bf glist\+\_\+t} glist\+\_\+add\+\_\+ptr (
\begin{DoxyParamCaption}
\item[{{\bf glist\+\_\+t}}]{g, }
\item[{void $\ast$}]{ptr}
\end{DoxyParamCaption}
)}\label{glist_8h_a77a9c20b7df5a289477af405ab778377}


Create and prepend a new list node, with the given user-\/defined data, at the H\+E\+A\+D of the given generic list. 

Return the new list thus formed. g may be N\+U\+L\+L to indicate an initially empty list. 
\begin{DoxyParams}{Parameters}
{\em g} & a link list \\
\hline
{\em ptr} & a pointer \\
\hline
\end{DoxyParams}


Definition at line 74 of file glist.\+c.



References ckd\+\_\+calloc, and gnode\+\_\+s\+::next.



Referenced by hash\+\_\+table\+\_\+tolist(), jsgf\+\_\+grammar\+\_\+new(), ngram\+\_\+model\+\_\+set\+\_\+read(), and parse\+\_\+subvecs().

\index{glist.\+h@{glist.\+h}!glist\+\_\+add\+\_\+uint32@{glist\+\_\+add\+\_\+uint32}}
\index{glist\+\_\+add\+\_\+uint32@{glist\+\_\+add\+\_\+uint32}!glist.\+h@{glist.\+h}}
\subsubsection[{glist\+\_\+add\+\_\+uint32}]{\setlength{\rightskip}{0pt plus 5cm}S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T {\bf glist\+\_\+t} glist\+\_\+add\+\_\+uint32 (
\begin{DoxyParamCaption}
\item[{{\bf glist\+\_\+t}}]{g, }
\item[{uint32}]{val}
\end{DoxyParamCaption}
)}\label{glist_8h_aeb741d435322f34df5e5d3a99abf00de}


Create and prepend a new list node containing an unsigned integer. 


\begin{DoxyParams}{Parameters}
{\em g} & a link list \\
\hline
{\em val} & an unsigned integer value \\
\hline
\end{DoxyParams}


Definition at line 98 of file glist.\+c.



References ckd\+\_\+calloc, and gnode\+\_\+s\+::next.

\index{glist.\+h@{glist.\+h}!glist\+\_\+count@{glist\+\_\+count}}
\index{glist\+\_\+count@{glist\+\_\+count}!glist.\+h@{glist.\+h}}
\subsubsection[{glist\+\_\+count}]{\setlength{\rightskip}{0pt plus 5cm}S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T int32 glist\+\_\+count (
\begin{DoxyParamCaption}
\item[{{\bf glist\+\_\+t}}]{g}
\end{DoxyParamCaption}
)}\label{glist_8h_aeb046e39c540d2f5f792119ea0d24c48}


Count the number of element in a given link list. 

\begin{DoxyReturn}{Returns}
the number of elements in the given glist\+\_\+t 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em g} & input link list \\
\hline
\end{DoxyParams}


Definition at line 145 of file glist.\+c.



References gnode\+\_\+s\+::next.



Referenced by ngram\+\_\+model\+\_\+set\+\_\+read(), and parse\+\_\+subvecs().

\index{glist.\+h@{glist.\+h}!glist\+\_\+free@{glist\+\_\+free}}
\index{glist\+\_\+free@{glist\+\_\+free}!glist.\+h@{glist.\+h}}
\subsubsection[{glist\+\_\+free}]{\setlength{\rightskip}{0pt plus 5cm}S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T void glist\+\_\+free (
\begin{DoxyParamCaption}
\item[{{\bf glist\+\_\+t}}]{g}
\end{DoxyParamCaption}
)}\label{glist_8h_a45380e15d2c33afc554fd60a8828580c}


Free the given generic list; user-\/defined data contained within is not automatically freed. 

The caller must have done that already. 

Definition at line 133 of file glist.\+c.



References ckd\+\_\+free(), and gnode\+\_\+s\+::next.



Referenced by cmd\+\_\+ln\+\_\+free\+\_\+r(), jsgf\+\_\+grammar\+\_\+free(), listelem\+\_\+alloc\+\_\+free(), ngram\+\_\+model\+\_\+add\+\_\+class(), ngram\+\_\+model\+\_\+read\+\_\+classdef(), ngram\+\_\+model\+\_\+set\+\_\+read(), and parse\+\_\+subvecs().

\index{glist.\+h@{glist.\+h}!glist\+\_\+insert\+\_\+float32@{glist\+\_\+insert\+\_\+float32}}
\index{glist\+\_\+insert\+\_\+float32@{glist\+\_\+insert\+\_\+float32}!glist.\+h@{glist.\+h}}
\subsubsection[{glist\+\_\+insert\+\_\+float32}]{\setlength{\rightskip}{0pt plus 5cm}S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T {\bf gnode\+\_\+t}$\ast$ glist\+\_\+insert\+\_\+float32 (
\begin{DoxyParamCaption}
\item[{{\bf gnode\+\_\+t} $\ast$}]{gn, }
\item[{float32}]{val}
\end{DoxyParamCaption}
)}\label{glist_8h_aff08aed022168872fc9d30cd299df2ce}


Create and insert a new list node containing a single-\/precision float. 


\begin{DoxyParams}{Parameters}
{\em gn} & a generic node which a value will be inserted after it \\
\hline
{\em val} & float32 inserted \\
\hline
\end{DoxyParams}


Definition at line 230 of file glist.\+c.



References ckd\+\_\+calloc, and gnode\+\_\+s\+::next.

\index{glist.\+h@{glist.\+h}!glist\+\_\+insert\+\_\+float64@{glist\+\_\+insert\+\_\+float64}}
\index{glist\+\_\+insert\+\_\+float64@{glist\+\_\+insert\+\_\+float64}!glist.\+h@{glist.\+h}}
\subsubsection[{glist\+\_\+insert\+\_\+float64}]{\setlength{\rightskip}{0pt plus 5cm}S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T {\bf gnode\+\_\+t}$\ast$ glist\+\_\+insert\+\_\+float64 (
\begin{DoxyParamCaption}
\item[{{\bf gnode\+\_\+t} $\ast$}]{gn, }
\item[{float64}]{val}
\end{DoxyParamCaption}
)}\label{glist_8h_a97a682e38319dd8f67765732467110f9}


Create and insert a new list node containing a double-\/precision float. 


\begin{DoxyParams}{Parameters}
{\em gn} & a generic node which a value will be inserted after it \\
\hline
{\em val} & float64 inserted \\
\hline
\end{DoxyParams}


Definition at line 244 of file glist.\+c.



References ckd\+\_\+calloc, and gnode\+\_\+s\+::next.

\index{glist.\+h@{glist.\+h}!glist\+\_\+insert\+\_\+int32@{glist\+\_\+insert\+\_\+int32}}
\index{glist\+\_\+insert\+\_\+int32@{glist\+\_\+insert\+\_\+int32}!glist.\+h@{glist.\+h}}
\subsubsection[{glist\+\_\+insert\+\_\+int32}]{\setlength{\rightskip}{0pt plus 5cm}S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T {\bf gnode\+\_\+t}$\ast$ glist\+\_\+insert\+\_\+int32 (
\begin{DoxyParamCaption}
\item[{{\bf gnode\+\_\+t} $\ast$}]{gn, }
\item[{int32}]{val}
\end{DoxyParamCaption}
)}\label{glist_8h_a327b6478ee05ac17e3c3b3189579413e}


Create and insert a new list node containing an integer. 


\begin{DoxyParams}{Parameters}
{\em gn} & a generic node which a value will be inserted after it \\
\hline
{\em val} & int32 inserted \\
\hline
\end{DoxyParams}


Definition at line 201 of file glist.\+c.



References ckd\+\_\+calloc, and gnode\+\_\+s\+::next.

\index{glist.\+h@{glist.\+h}!glist\+\_\+insert\+\_\+ptr@{glist\+\_\+insert\+\_\+ptr}}
\index{glist\+\_\+insert\+\_\+ptr@{glist\+\_\+insert\+\_\+ptr}!glist.\+h@{glist.\+h}}
\subsubsection[{glist\+\_\+insert\+\_\+ptr}]{\setlength{\rightskip}{0pt plus 5cm}S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T {\bf gnode\+\_\+t}$\ast$ glist\+\_\+insert\+\_\+ptr (
\begin{DoxyParamCaption}
\item[{{\bf gnode\+\_\+t} $\ast$}]{gn, }
\item[{void $\ast$}]{ptr}
\end{DoxyParamCaption}
)}\label{glist_8h_a2d641da6b349c1c939e3b954382513ba}


Create and insert a new list node, with the given user-\/defined data, after the given generic node gn. 

gn cannot be N\+U\+L\+L. Return ptr to the newly created gnode\+\_\+t. 
\begin{DoxyParams}{Parameters}
{\em gn} & a generic node which ptr will be inserted after it \\
\hline
{\em ptr} & pointer inserted \\
\hline
\end{DoxyParams}


Definition at line 187 of file glist.\+c.



References ckd\+\_\+calloc, and gnode\+\_\+s\+::next.

\index{glist.\+h@{glist.\+h}!glist\+\_\+insert\+\_\+uint32@{glist\+\_\+insert\+\_\+uint32}}
\index{glist\+\_\+insert\+\_\+uint32@{glist\+\_\+insert\+\_\+uint32}!glist.\+h@{glist.\+h}}
\subsubsection[{glist\+\_\+insert\+\_\+uint32}]{\setlength{\rightskip}{0pt plus 5cm}S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T {\bf gnode\+\_\+t}$\ast$ glist\+\_\+insert\+\_\+uint32 (
\begin{DoxyParamCaption}
\item[{{\bf gnode\+\_\+t} $\ast$}]{gn, }
\item[{uint32}]{val}
\end{DoxyParamCaption}
)}\label{glist_8h_ab7e58ee641d3648f047eef70a20a4647}


Create and insert a new list node containing an unsigned integer. 


\begin{DoxyParams}{Parameters}
{\em gn} & a generic node which a value will be inserted after it \\
\hline
{\em val} & uint32 inserted \\
\hline
\end{DoxyParams}


Definition at line 215 of file glist.\+c.



References ckd\+\_\+calloc, and gnode\+\_\+s\+::next.

\index{glist.\+h@{glist.\+h}!glist\+\_\+reverse@{glist\+\_\+reverse}}
\index{glist\+\_\+reverse@{glist\+\_\+reverse}!glist.\+h@{glist.\+h}}
\subsubsection[{glist\+\_\+reverse}]{\setlength{\rightskip}{0pt plus 5cm}S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T {\bf glist\+\_\+t} glist\+\_\+reverse (
\begin{DoxyParamCaption}
\item[{{\bf glist\+\_\+t}}]{g}
\end{DoxyParamCaption}
)}\label{glist_8h_a399a2a093c6c4ce1012762e4c25c8185}


Reverse the order of the given glist. 

(glist\+\_\+add() adds to the head; one might ultimately want the reverse of that.) N\+O\+T\+E\+: The list is reversed \char`\"{}in place\char`\"{}; i.\+e., no new memory is allocated. \begin{DoxyReturn}{Returns}
\+: The head of the new list. 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em g} & input link list \\
\hline
\end{DoxyParams}


Definition at line 169 of file glist.\+c.



References gnode\+\_\+s\+::next.



Referenced by jsgf\+\_\+grammar\+\_\+new(), ngram\+\_\+model\+\_\+add\+\_\+class(), and ngram\+\_\+model\+\_\+set\+\_\+read().

\index{glist.\+h@{glist.\+h}!gnode\+\_\+free@{gnode\+\_\+free}}
\index{gnode\+\_\+free@{gnode\+\_\+free}!glist.\+h@{glist.\+h}}
\subsubsection[{gnode\+\_\+free}]{\setlength{\rightskip}{0pt plus 5cm}S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T {\bf gnode\+\_\+t}$\ast$ gnode\+\_\+free (
\begin{DoxyParamCaption}
\item[{{\bf gnode\+\_\+t} $\ast$}]{gn, }
\item[{{\bf gnode\+\_\+t} $\ast$}]{pred}
\end{DoxyParamCaption}
)}\label{glist_8h_a68b51aea4de463b284a19668a713d502}


Free the given node, gn, of a glist, pred being its predecessor in the list. 

Return ptr to the next node in the list after the freed node. 

Definition at line 257 of file glist.\+c.



References ckd\+\_\+free(), and gnode\+\_\+s\+::next.

