82 #ifndef _LIBUTIL_GLIST_H_
83 #define _LIBUTIL_GLIST_H_
87 #include <sphinxbase/sphinxbase_export.h>
109 #define gnode_ptr(g) ((g)->data.ptr)
110 #define gnode_int32(g) ((g)->data.i)
111 #define gnode_uint32(g) ((g)->data.ui)
112 #define gnode_float32(g) ((float32)(g)->data.fl)
113 #define gnode_float64(g) ((g)->data.fl)
114 #define gnode_next(g) ((g)->next)
SPHINXBASE_EXPORT glist_t glist_add_float32(glist_t g, float32 val)
Create and prepend a new list node containing a single-precision float.
SPHINXBASE_EXPORT glist_t glist_add_int32(glist_t g, int32 val)
Create and prepend a new list node containing an integer.
struct gnode_s gnode_t
A node in a generic list.
SPHINXBASE_EXPORT gnode_t * glist_insert_uint32(gnode_t *gn, uint32 val)
Create and insert a new list node containing an unsigned integer.
SPHINXBASE_EXPORT gnode_t * glist_insert_int32(gnode_t *gn, int32 val)
Create and insert a new list node containing an integer.
A node in a generic list.
Basic type definitions used in Sphinx.
SPHINXBASE_EXPORT glist_t glist_add_ptr(glist_t g, void *ptr)
Create and prepend a new list node, with the given user-defined data, at the HEAD of the given generi...
SPHINXBASE_EXPORT gnode_t * glist_insert_float64(gnode_t *gn, float64 val)
Create and insert a new list node containing a double-precision float.
SPHINXBASE_EXPORT glist_t glist_reverse(glist_t g)
Reverse the order of the given glist.
SPHINXBASE_EXPORT void glist_free(glist_t g)
Free the given generic list; user-defined data contained within is not automatically freed...
SPHINXBASE_EXPORT gnode_t * gnode_free(gnode_t *gn, gnode_t *pred)
Free the given node, gn, of a glist, pred being its predecessor in the list.
SPHINXBASE_EXPORT gnode_t * glist_tail(glist_t g)
Return the last node in the given list.
SPHINXBASE_EXPORT gnode_t * glist_insert_float32(gnode_t *gn, float32 val)
Create and insert a new list node containing a single-precision float.
struct gnode_s * next
See prim_type.h.
SPHINXBASE_EXPORT glist_t glist_add_float64(glist_t g, float64 val)
Create and prepend a new list node containing a double-precision float.
SPHINXBASE_EXPORT glist_t glist_add_uint32(glist_t g, uint32 val)
Create and prepend a new list node containing an unsigned integer.
SPHINXBASE_EXPORT int32 glist_count(glist_t g)
Count the number of element in a given link list.
SPHINXBASE_EXPORT gnode_t * glist_insert_ptr(gnode_t *gn, void *ptr)
Create and insert a new list node, with the given user-defined data, after the given generic node gn...