SphinxBase 0.6

include/sphinxbase/libutil.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  * libutil.h -- Collection of all other .h files in this directory; for brevity
00039  *
00040  * **********************************************
00041  * CMU ARPA Speech Project
00042  *
00043  * Copyright (c) 1996 Carnegie Mellon University.
00044  * ALL RIGHTS RESERVED.
00045  * **********************************************
00046  * 
00047  * HISTORY
00048  * $Log: libutil.h,v $
00049  * Revision 1.14  2005/06/22 03:07:21  arthchan2003
00050  * Add  keyword.
00051  *
00052  * Revision 1.4  2005/06/15 06:23:21  archan
00053  * change headers from io.h to pio.h
00054  *
00055  * Revision 1.3  2005/03/30 01:22:48  archan
00056  * Fixed mistakes in last updates. Add
00057  *
00058  * 
00059  * 08-Dec-1999  M K Ravishankar (rkm@cs.cmu.edu) at Carnegie Mellon
00060  *              Added SLEEP_SEC macro.
00061  * 
00062  * 08-31-95     M K Ravishankar (rkm@cs.cmu.edu) at Carnegie Mellon
00063  *              Created.
00064  */
00065 
00066 
00067 #ifndef _LIBUTIL_LIBUTIL_H_
00068 #define _LIBUTIL_LIBUTIL_H_
00069 
00078 #include <stdio.h>
00079 #include <stdlib.h>
00080 #include <string.h>
00081 #include <assert.h>
00082 #ifndef WIN32                   /* RAH */
00083 #include <unistd.h>
00084 #endif /* RAH */
00085 #include <math.h>
00086 
00087 /* Win32/WinCE DLL gunk */
00088 #include <sphinxbase/sphinxbase_export.h>
00089 
00090 #include <sphinxbase/prim_type.h>
00091 #include <sphinxbase/bitvec.h>
00092 #include <sphinxbase/case.h>
00093 #include <sphinxbase/ckd_alloc.h>
00094 #include <sphinxbase/listelem_alloc.h>
00095 #include <sphinxbase/cmd_ln.h>
00096 #include <sphinxbase/err.h>
00097 #include <sphinxbase/filename.h>
00098 #include <sphinxbase/glist.h>
00099 #include <sphinxbase/hash_table.h>
00100 #include <sphinxbase/heap.h>
00101 #include <sphinxbase/pio.h>
00102 #include <sphinxbase/profile.h>
00103 #include <sphinxbase/strfuncs.h>
00104 #include <sphinxbase/unlimit.h>
00105 #include <sphinxbase/info.h>
00106 #include <sphinxbase/genrand.h>
00107 
00108 
00109 #ifdef __cplusplus
00110 extern "C" {
00111 #endif
00112 #if 0
00113 /* Fool Emacs. */
00114 }
00115 #endif
00116 
00117 
00118 #if (defined(WIN32) && !defined(__CYGWIN__))
00119 #define SLEEP_SEC(sec)  (0)                     /* Why doesn't Sleep((sec)*1000) work? */
00120 #else
00121 #define SLEEP_SEC(sec)  sleep(sec)              /* sec must be integer */
00122 #endif
00123 
00124 #ifndef TRUE
00125 #define TRUE    1
00126 #define FALSE   0
00127 #endif
00128 
00129 #ifndef M_PI
00130 #define M_PI            3.1415926535897932385   /* For the pain-in-the-neck Win32 */
00131 #endif
00132 #define PI              M_PI
00133 
00134 #ifdef __cplusplus
00135 }
00136 #endif
00137 
00138 
00139 #endif