s2types.h
00001 /* ==================================================================== 00002 * Copyright (c) 1999-2004 Carnegie Mellon University. All rights 00003 * reserved. 00004 * 00005 * Redistribution and use in source and binary forms, with or without 00006 * modification, are permitted provided that the following conditions 00007 * are met: 00008 * 00009 * 1. Redistributions of source code must retain the above copyright 00010 * notice, this list of conditions and the following disclaimer. 00011 * 00012 * 2. Redistributions in binary form must reproduce the above copyright 00013 * notice, this list of conditions and the following disclaimer in 00014 * the documentation and/or other materials provided with the 00015 * distribution. 00016 * 00017 * 00018 * THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY ``AS IS'' AND 00019 * ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 00020 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00021 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY 00022 * NOR ITS EMPLOYEES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00023 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00024 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00025 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00026 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00027 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00028 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00029 * 00030 * ==================================================================== 00031 * 00032 */ 00033 00034 /* 00035 * prim_type.h -- Primitive types; more machine-independent. 00036 * 00037 * ********************************************** 00038 * CMU ARPA Speech Project 00039 * 00040 * Copyright (c) 1999 Carnegie Mellon University. 00041 * ALL RIGHTS RESERVED. 00042 * ********************************************** 00043 * 00044 * HISTORY 00045 * 00046 * $Log$ 00047 * Revision 1.2 2008/03/03 21:46:04 gerkey 00048 * inserted new s2types.h, following user experience 00049 * 00050 * Revision 1.1 2006/04/20 01:05:29 gerkey 00051 * changed sphinx2 configure check, added s2types.h 00052 * 00053 * Revision 1.7 2005/10/04 23:56:30 dhdfu 00054 * Explicitly define int8 as signed, otherwise it will be unsigned on ARM 00055 * and PowerPC, and Sphinx3 model definition files won't work. 00056 * 00057 * Revision 1.6 2004/12/10 16:48:56 rkm 00058 * Added continuous density acoustic model handling 00059 * 00060 * 00061 * 12-Mar-1999 M K Ravishankar (rkm@cs.cmu.edu) at Carnegie Mellon 00062 * Added some useful constant definitions. 00063 * 00064 * Revision 1.5 2004/07/16 00:57:10 egouvea 00065 * Added Ravi's implementation of FSG support. 00066 * 00067 * Revision 1.2 2004/05/27 14:22:57 rkm 00068 * FSG cross-word triphones completed (but for single-phone words) 00069 * 00070 * Revision 1.1.1.1 2004/03/01 14:30:20 rkm 00071 * 00072 * 00073 * Revision 1.3 2004/02/09 21:19:35 rkm 00074 * Added bool 00075 * 00076 * Revision 1.2 2004/01/23 19:20:03 rkm 00077 * *** empty log message *** 00078 * 00079 * 00080 * 02-Aug-1999 Kevin A. Lenzo (lenzo@cs.cmu.edu) at Carnegie Mellon 00081 * Copied from s3 and cut out everything but the typedefs. 00082 * 00083 * 12-Mar-1999 M K Ravishankar (rkm@cs.cmu.edu) at Carnegie Mellon 00084 * Added arraysize_t, point_t, fpoint_t. 00085 * 00086 * 01-Feb-1999 M K Ravishankar (rkm@cs.cmu.edu) at Carnegie Mellon 00087 * Added anytype_t. 00088 * 00089 * 08-31-95 M K Ravishankar (rkm@cs.cmu.edu) at Carnegie Mellon 00090 * Created. 00091 */ 00092 00093 00094 #ifndef __S2TYPES_H__ 00095 #define __S2TYPES_H__ 00096 00097 00098 typedef int int32; 00099 typedef short int16; 00100 typedef signed char int8; 00101 typedef unsigned int uint32; 00102 typedef unsigned short uint16; 00103 typedef unsigned char uint8; 00104 typedef float float32; 00105 typedef double float64; 00106 typedef unsigned char boolean; 00107 00108 #ifndef TRUE 00109 #define TRUE 1 00110 #endif 00111 #ifndef FALSE 00112 #define FALSE 0 00113 #endif 00114 00115 #ifndef NULL 00116 #define NULL (void *)0 00117 #endif 00118 00119 00120 /* Useful constants */ 00121 #define MAX_INT32 ((int32) 0x7fffffff) 00122 #define MAX_INT16 ((int16) 0x00007fff) 00123 #define MAX_INT8 ((int8) 0x0000007f) 00124 00125 #define MAX_NEG_INT32 ((int32) 0x80000000) 00126 #define MAX_NEG_INT16 ((int16) 0xffff8000) 00127 #define MAX_NEG_INT8 ((int8) 0xffffff80) 00128 00129 #define MAX_UINT64 ((uint64) 0xffffffffffffffff) 00130 #define MAX_UINT32 ((uint32) 0xffffffff) 00131 #define MAX_UINT16 ((uint16) 0x0000ffff) 00132 #define MAX_UINT8 ((uint8) 0x000000ff) 00133 00134 /* The following are approximate; IEEE floating point standards might quibble! */ 00135 #define MAX_POS_FLOAT32 3.4e+38f 00136 #define MIN_POS_FLOAT32 1.2e-38f /* But not 0 */ 00137 #define MAX_POS_FLOAT64 1.8e+307 00138 #define MIN_POS_FLOAT64 2.2e-308 00139 00140 /* Will the following really work?? */ 00141 #define MAX_NEG_FLOAT32 ((float32) (-MAX_POS_FLOAT32)) 00142 #define MIN_NEG_FLOAT32 ((float32) (-MIN_POS_FLOAT32)) 00143 #define MAX_NEG_FLOAT64 ((float64) (-MAX_POS_FLOAT64)) 00144 #define MIN_NEG_FLOAT64 ((float64) (-MIN_POS_FLOAT64)) 00145 00146 /* 00147 typedef union anytype_s { 00148 boolean boolean; 00149 int8 int8; 00150 uint8 uint8; 00151 int16 int16; 00152 uint16 uint16; 00153 int32 int32; 00154 uint32 uint32; 00155 float32 float32; 00156 float64 float64; 00157 void *ptr; 00158 } anytype_t; 00159 */ 00160 00161 #endif