SphinxBase  0.6
libutil.h
Go to the documentation of this file.
1 /* -*- c-basic-offset: 4; indent-tabs-mode: nil -*- */
2 /* ====================================================================
3  * Copyright (c) 1999-2004 Carnegie Mellon University. All rights
4  * reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  *
10  * 1. Redistributions of source code must retain the above copyright
11  * notice, this list of conditions and the following disclaimer.
12  *
13  * 2. Redistributions in binary form must reproduce the above copyright
14  * notice, this list of conditions and the following disclaimer in
15  * the documentation and/or other materials provided with the
16  * distribution.
17  *
18  * This work was supported in part by funding from the Defense Advanced
19  * Research Projects Agency and the National Science Foundation of the
20  * United States of America, and the CMU Sphinx Speech Consortium.
21  *
22  * THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY ``AS IS'' AND
23  * ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
24  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
25  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY
26  * NOR ITS EMPLOYEES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33  *
34  * ====================================================================
35  *
36  */
37 /*
38  * libutil.h -- Collection of all other .h files in this directory; for brevity
39  *
40  * **********************************************
41  * CMU ARPA Speech Project
42  *
43  * Copyright (c) 1996 Carnegie Mellon University.
44  * ALL RIGHTS RESERVED.
45  * **********************************************
46  *
47  * HISTORY
48  * $Log: libutil.h,v $
49  * Revision 1.14 2005/06/22 03:07:21 arthchan2003
50  * Add keyword.
51  *
52  * Revision 1.4 2005/06/15 06:23:21 archan
53  * change headers from io.h to pio.h
54  *
55  * Revision 1.3 2005/03/30 01:22:48 archan
56  * Fixed mistakes in last updates. Add
57  *
58  *
59  * 08-Dec-1999 M K Ravishankar (rkm@cs.cmu.edu) at Carnegie Mellon
60  * Added SLEEP_SEC macro.
61  *
62  * 08-31-95 M K Ravishankar (rkm@cs.cmu.edu) at Carnegie Mellon
63  * Created.
64  */
65 
66 
67 #ifndef _LIBUTIL_LIBUTIL_H_
68 #define _LIBUTIL_LIBUTIL_H_
69 
78 #include <stdio.h>
79 #include <stdlib.h>
80 #include <string.h>
81 #include <assert.h>
82 #ifndef WIN32 /* RAH */
83 #include <unistd.h>
84 #endif /* RAH */
85 #include <math.h>
86 
87 /* Win32/WinCE DLL gunk */
88 #include <sphinxbase/sphinxbase_export.h>
89 
90 #include <sphinxbase/prim_type.h>
91 #include <sphinxbase/bitvec.h>
92 #include <sphinxbase/case.h>
93 #include <sphinxbase/ckd_alloc.h>
95 #include <sphinxbase/cmd_ln.h>
96 #include <sphinxbase/err.h>
97 #include <sphinxbase/filename.h>
98 #include <sphinxbase/glist.h>
99 #include <sphinxbase/hash_table.h>
100 #include <sphinxbase/heap.h>
101 #include <sphinxbase/pio.h>
102 #include <sphinxbase/profile.h>
103 #include <sphinxbase/strfuncs.h>
104 #include <sphinxbase/unlimit.h>
105 #include <sphinxbase/info.h>
106 #include <sphinxbase/genrand.h>
107 
108 
109 #ifdef __cplusplus
110 extern "C" {
111 #endif
112 #if 0
113 /* Fool Emacs. */
114 }
115 #endif
116 
117 
118 #if (defined(WIN32) && !defined(__CYGWIN__))
119 #define SLEEP_SEC(sec) (0) /* Why doesn't Sleep((sec)*1000) work? */
120 #else
121 #define SLEEP_SEC(sec) sleep(sec) /* sec must be integer */
122 #endif
123 
124 #ifndef TRUE
125 #define TRUE 1
126 #define FALSE 0
127 #endif
128 
129 #ifndef M_PI
130 #define M_PI 3.1415926535897932385 /* For the pain-in-the-neck Win32 */
131 #endif
132 #define PI M_PI
133 
134 #ifdef __cplusplus
135 }
136 #endif
137 
138 
139 #endif