• Main Page
  • Related Pages
  • Data Structures
  • Files
  • File List
  • Globals

include/glist.h

Go to the documentation of this file.
00001 /* -*- c-basic-offset: 4; indent-tabs-mode: nil -*- */
00002 /* ====================================================================
00003  * Copyright (c) 1999-2004 Carnegie Mellon University.  All rights
00004  * reserved.
00005  *
00006  * Redistribution and use in source and binary forms, with or without
00007  * modification, are permitted provided that the following conditions
00008  * are met:
00009  *
00010  * 1. Redistributions of source code must retain the above copyright
00011  *    notice, this list of conditions and the following disclaimer. 
00012  *
00013  * 2. Redistributions in binary form must reproduce the above copyright
00014  *    notice, this list of conditions and the following disclaimer in
00015  *    the documentation and/or other materials provided with the
00016  *    distribution.
00017  *
00018  * This work was supported in part by funding from the Defense Advanced 
00019  * Research Projects Agency and the National Science Foundation of the 
00020  * United States of America, and the CMU Sphinx Speech Consortium.
00021  *
00022  * THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY ``AS IS'' AND 
00023  * ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
00024  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00025  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY
00026  * NOR ITS EMPLOYEES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00027  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
00028  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
00029  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
00030  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
00031  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
00032  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00033  *
00034  * ====================================================================
00035  *
00036  */
00037 /*
00038  * glist.h -- Module for maintaining a generic, linear linked-list structure.
00039  *
00040  * **********************************************
00041  * CMU ARPA Speech Project
00042  *
00043  * Copyright (c) 1999 Carnegie Mellon University.
00044  * ALL RIGHTS RESERVED.
00045  * **********************************************
00046  * 
00047  * HISTORY
00048  * $Log: glist.h,v $
00049  * Revision 1.9  2005/06/22 03:02:51  arthchan2003
00050  * 1, Fixed doxygen documentation, 2, add  keyword.
00051  *
00052  * Revision 1.4  2005/05/03 04:09:11  archan
00053  * 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.
00054  *
00055  * Revision 1.3  2005/03/30 01:22:48  archan
00056  * Fixed mistakes in last updates. Add
00057  *
00058  * 
00059  * 09-Mar-1999  M K Ravishankar (rkm@cs.cmu.edu) at Carnegie Mellon University
00060  *              Added glist_chkdup_*().
00061  * 
00062  * 13-Feb-1999  M K Ravishankar (rkm@cs.cmu.edu) at Carnegie Mellon University
00063  *              Created from earlier version.
00064  */
00065 
00066 
00082 #ifndef _LIBUTIL_GLIST_H_
00083 #define _LIBUTIL_GLIST_H_
00084 
00085 #include <stdlib.h>
00086 /* Win32/WinCE DLL gunk */
00087 #include <sphinxbase_export.h>
00088 #include <prim_type.h>
00089 
00090 #ifdef __cplusplus
00091 extern "C" {
00092 #endif
00093 #if 0
00094 /* Fool Emacs. */
00095 }
00096 #endif
00097 
00100 typedef struct gnode_s {
00101         anytype_t data;         
00102         struct gnode_s *next;   
00103 } gnode_t;
00104 typedef gnode_t *glist_t;       
00109 #define gnode_ptr(g)            ((g)->data.ptr)
00110 #define gnode_int32(g)          ((g)->data.i)
00111 #define gnode_uint32(g)         ((g)->data.ui)
00112 #define gnode_float32(g)        ((float32)(g)->data.fl)
00113 #define gnode_float64(g)        ((g)->data.fl)
00114 #define gnode_next(g)           ((g)->next)
00115 
00116 
00122 SPHINXBASE_EXPORT
00123 glist_t glist_add_ptr (glist_t g,  
00124                        void *ptr   
00125         );
00126 
00130 SPHINXBASE_EXPORT
00131 glist_t glist_add_int32 (glist_t g, 
00132                          int32 val  
00133         );
00137 SPHINXBASE_EXPORT
00138 glist_t glist_add_uint32 (glist_t g,  
00139                           uint32 val  
00140         );
00144 SPHINXBASE_EXPORT
00145 glist_t glist_add_float32 (glist_t g, 
00146                            float32 val 
00147         );
00151 SPHINXBASE_EXPORT
00152 glist_t glist_add_float64 (glist_t g, 
00153                            float64 val  
00154         );
00155 
00156 
00157 
00163 SPHINXBASE_EXPORT
00164 gnode_t *glist_insert_ptr (gnode_t *gn, 
00165                            void *ptr 
00166         );
00170 SPHINXBASE_EXPORT
00171 gnode_t *glist_insert_int32 (gnode_t *gn, 
00172                              int32 val 
00173         );
00177 SPHINXBASE_EXPORT
00178 gnode_t *glist_insert_uint32 (gnode_t *gn, 
00179                               uint32 val 
00180         );
00184 SPHINXBASE_EXPORT
00185 gnode_t *glist_insert_float32 (gnode_t *gn, 
00186                                float32 val 
00187         );
00191 SPHINXBASE_EXPORT
00192 gnode_t *glist_insert_float64 (gnode_t *gn, 
00193                                float64 val 
00194         );
00195 
00202 SPHINXBASE_EXPORT
00203 glist_t glist_reverse (glist_t g 
00204         );
00205 
00206 
00211 SPHINXBASE_EXPORT
00212 int32 glist_count (glist_t g 
00213         );
00214 
00219 SPHINXBASE_EXPORT
00220 void glist_free (glist_t g);
00221 
00222 
00227 SPHINXBASE_EXPORT
00228 gnode_t *gnode_free(gnode_t *gn, 
00229                     gnode_t *pred
00230         );
00231 
00235 SPHINXBASE_EXPORT
00236 gnode_t *glist_tail (glist_t g);
00237 
00238 #ifdef __cplusplus
00239 }
00240 #endif
00241 
00242 #endif

Generated on Thu Jan 6 2011 for SphinxBase by  doxygen 1.7.1