Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

stddefs.h

Go to the documentation of this file.
00001 
00034 /*
00035  * Copyright (c) 1991-2006 Kawahara Lab., Kyoto University
00036  * Copyright (c) 2000-2005 Shikano Lab., Nara Institute of Science and Technology
00037  * Copyright (c) 2005-2006 Julius project team, Nagoya Institute of Technology, Nagoya Institute of Technology
00038  * All rights reserved
00039  */
00040 
00041 #ifndef __SENT_STANDARD_DEFS__
00042 #define __SENT_STANDARD_DEFS__
00043 
00044 /* load site-dependent configuration by configure script */
00045 #if defined(_WIN32) && !defined(__CYGWIN32__) && !defined(__MINGW32__)
00046 #include <sent/config-win.h>
00047 #else
00048 #include <sent/config.h>
00049 #endif
00050 
00051 #include <stdio.h>
00052 #include <stdlib.h>
00053 #include <strings.h>
00054 #include <string.h>
00055 #include <math.h>
00056 #if !defined(_WIN32) || defined(__CYGWIN32__) || defined(__MINGW32__)
00057 /* unixen */
00058 #ifdef HAVE_UNISTD_H
00059 #include <unistd.h>
00060 #endif
00061 #include <strings.h>
00062 #include <sys/time.h>
00063 #else
00064 /* win32 */
00065 #include <io.h>
00066 #define sleep(x) Sleep(x)
00067 #endif
00068 
00069 #include <errno.h>
00070 #include <fcntl.h>
00071 #include <sys/types.h>
00072 
00073 #include <sent/machines.h>
00074 
00076 #if !defined(PI)
00077 #define PI 3.14159265358979
00078 #endif
00079 
00080 #if !defined(TPI)
00081 #define TPI 6.28318530717959 
00082 #endif
00083 
00084 #if !defined(LOGTPI)
00085 #define LOGTPI 1.83787706640935
00086 #endif
00087 
00088 #if !defined(LOG_TEN)
00089 #define LOG_TEN 2.30258509
00090 #endif
00091 
00093 typedef unsigned char boolean;
00094 #define TRUE 1
00095 #define FALSE 0
00096 
00097 #if defined(_WIN32) && !defined(__CYGWIN32__) && !defined(__MINGW32__)
00098 /* win32 functions */
00099 #define getpagesize() (4096)
00100 #define access _access        
00101 #define chmod _chmod
00102 #define close _close
00103 #define eof _eof
00104 #define filelength _filelength
00105 #define isatty _isatty
00106 #define lseek _lseek
00107 #define open _open
00108 #define read _read
00109 #define write _write
00110 #define mkdir _mkdir
00111 #define unlink _unlink
00112 #define getcwd _getcwd
00113 #define getpid _getpid
00114 #define vsnprintf _vsnprintf
00115 #define snprintf _snprintf
00116 #endif
00117 
00118 #ifndef R_OK
00119 #define R_OK 4
00120 #endif
00121 #ifndef W_OK
00122 #define W_OK 2
00123 #endif
00124 #ifndef X_OK
00125 # if defined(_WIN32) && !defined(__CYGWIN32__) && !defined(__MINGW32__)
00126 # define X_OK 0
00127 # else
00128 # define X_OK 1
00129 # endif
00130 #endif
00131 #ifndef F_OK
00132 #define F_OK 0
00133 #endif
00134 
00135 /* some macros */
00136 #undef max
00137 #undef min
00138 #define max(A,B)        ((A)>=(B)?(A):(B))
00139 #define min(A,B)        ((A)<(B)?(A):(B))
00140 #define abs(X)          ((X)>0?(X):-(X))
00141 
00142 #define strmatch        !strcmp
00143 
00144 #define strnmatch       !strncmp
00145 
00146 #define DELM " \t\n"
00147 
00149 #define LOG_ZERO        -1000000
00150 
00154 #define LOG_ADDMIN      -13.815510558
00155 
00157 enum LogOutputLevel {
00158   LOG_NORMAL,                   
00159   LOG_VERBOSE,                  
00160   LOG_DEBUG                     
00161 };
00162 
00164 enum {
00165   DIR_LR,                       
00166   DIR_RL                        
00167 };
00168 
00170 /* you can't use double for typedefs below */
00171 /* also look at lib/util/mybmalloc.c */
00172 typedef float PROB;             
00173 typedef float LOGPROB;          
00174 typedef short SP16;             
00175 typedef float VECT;             
00176 
00177 
00178 #ifdef WORDS_INT
00179 /* maximum number of words = 2G = 2^31 (--enable-words-int) */
00180 typedef int WORD_ID;            
00181 #define MAX_WORD_NUM 2147483647 
00182 #define WORD_INVALID 2147483647 
00183 #else
00184 /* maximum number of words = 65535 */
00185 typedef unsigned short WORD_ID; 
00186 #define MAX_WORD_NUM 65535      
00187 #define WORD_INVALID 65535      
00188 #endif
00189 
00191 #define MAXLINELEN 1024
00192 
00193 #include <sent/util.h>
00194 
00195 #endif /* __SENT_STANDARD_DEFS__ */

Generated on Tue Mar 28 16:17:42 2006 for Julius by  doxygen 1.4.2