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_export.h> 00089 00090 #include <prim_type.h> 00091 #include <case.h> 00092 #include <ckd_alloc.h> 00093 #include <cmd_ln.h> 00094 #include <err.h> 00095 #include <glist.h> 00096 #include <hash_table.h> 00097 #include <info.h> 00098 00099 00100 #ifdef __cplusplus 00101 extern "C" { 00102 #endif 00103 #if 0 00104 /* Fool Emacs. */ 00105 } 00106 #endif 00107 00108 00109 #if (defined(WIN32) && !defined(__CYGWIN__)) 00110 #define SLEEP_SEC(sec) (0) /* Why doesn't Sleep((sec)*1000) work? */ 00111 #else 00112 #define SLEEP_SEC(sec) sleep(sec) /* sec must be integer */ 00113 #endif 00114 00115 #ifndef TRUE 00116 #define TRUE 1 00117 #define FALSE 0 00118 #endif 00119 00120 #ifndef M_PI 00121 #define M_PI 3.1415926535897932385 /* For the pain-in-the-neck Win32 */ 00122 #endif 00123 #define PI M_PI 00124 00125 #ifdef __cplusplus 00126 } 00127 #endif 00128 00129 00130 #endif