• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*---------------------------------------------------------------------------*
2  *  duk_err.h  *
3  *                                                                           *
4  *  Copyright 2007, 2008 Nuance Communciations, Inc.                               *
5  *                                                                           *
6  *  Licensed under the Apache License, Version 2.0 (the 'License');          *
7  *  you may not use this file except in compliance with the License.         *
8  *                                                                           *
9  *  You may obtain a copy of the License at                                  *
10  *      http://www.apache.org/licenses/LICENSE-2.0                           *
11  *                                                                           *
12  *  Unless required by applicable law or agreed to in writing, software      *
13  *  distributed under the License is distributed on an 'AS IS' BASIS,        *
14  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
15  *  See the License for the specific language governing permissions and      *
16  *  limitations under the License.                                           *
17  *                                                                           *
18  *---------------------------------------------------------------------------*/
19 
20 
21 #ifndef _h_duk_err_
22 #define _h_duk_err_
23 
24 #ifdef SET_RCSID
25 static const char duk_err_h[] = "$Id: duk_err.h,v 1.5.6.5 2007/08/31 17:44:52 dahan Exp $";
26 #endif
27 
28 /** Still need this enum */
29 enum CrecException
30 {
31   TIME_OUT_ERROR,  /* general operational errors */
32   FEATURE_NOT_SUPPORTED,
33   BAD_PARAMETER,
34   BAD_ARGUMENT,
35   BAD_INDEX,
36   UNEXPECTED_STATE_ERROR,
37   UNEXPECTED_DATA_ERROR,
38   PREMATURE_EXIT,
39   BAD_TUNNEL,
40   FFT_TOO_SMALL,
41   BAD_COSINE_TRANSFORM,
42   ZERO_SPACE_ALLOC,  /* memory allocation errors */
43   NO_SPACE_FOR_MALLOC,
44   NO_SPACE_FOR_REALLOC,
45   NO_SPACE_IN_OSHEAP,
46   FREE_INVALID_POINTER,
47   UNALLOCATED_VARIABLE,
48   UNFREED_VARIABLE,
49   STATE_LINK_ERROR,
50   NO_ACTIVE_PATHS,
51   SELF_LOOP_NODE,
52   POLLUTED_TRACEBACK,
53   NO_SPACE_FOR_LINKS,
54   NO_SPACE_FOR_HIST,
55   NO_SPACE_FOR_BACKPTR,
56   BAD_SYNTAX_NODE,
57   SYNTAX_UNSPECIFIED,
58   BAD_SYNTAX,
59   BAD_MODEL,
60   INCORRECT_MODEL_TYPE,
61   BAD_WW_MODEL_NAME,
62   NO_MODEL_FOR_SYNTAX,
63   MISMATCHED_MODEL_FOR_SYNTAX,
64   BAD_SILENCE_MODEL,
65   BAD_CONTEXT,
66   BAD_GRAMMAR,
67   BAD_MULTABLE,
68   BAD_PEL_DATA,
69   BAD_CHANNEL,
70   BAD_PICTYPE_IN_ARB,
71   STREAM_OPEN_FAILED,         /* data transmission errors */
72   STREAM_CLOSE_FAILED,
73   STREAM_READ_FAILED,
74   STREAM_WRITE_FAILED,
75   STREAM_ALREADY_OPEN,
76   FILE_OPEN_FAILED,  /* file handling errors */
77   FILE_SEEK_FAILED,
78   BAD_DATA_IN_FILE,
79   UNSUPPORTED_DATA_IN_FILE,
80   FILE_WRITE_ERROR,
81   FILE_READ_ERROR,
82   INCORRECT_FILE_VERSION,
83   MISSING_FILE_VERSION,
84   RECOGNITION_RESULT,  /* diagnostic messages */
85   DIAG_MESSAGE,
86   BAD_RESULT,
87   BAD_IMELDA,
88   BAD_MLLR_TRANSFORM,
89   BAD_COVARIANCE,
90   BAD_OPERATION,
91   SINGULAR_MATRIX,
92   BAD_WAV_DEVICE,
93   BAD_LATTICE,
94   NO_SPACE_FOR_LATTICE,
95   DFILE_EXCEPTION,
96   WINSOUND_EXCEPTION,
97   INTERNAL_ERROR,
98   RECOGNIZER_NOT_LOADED,
99   RECOGNIZER_ALREADY_LOADED,
100   RECOGNIZER_NOT_SETUP,
101   RECOGNIZER_ALREADY_SETUP,
102   RECOGNIZER_NOT_STARTED,
103   RECOGNIZER_ALREADY_STARTED,
104   RECOGNIZER_NOT_CONFIGURED,
105   RECOGNIZER_ALREADY_CONFIGURED,
106   RECOGNIZER_HAS_RESULTS,
107   RECOGNIZER_NO_RESULTS,
108   ACOUSTIC_ALREADY_LOADED,
109   ACOUSTIC_NOT_LOADED,
110   ACOUSTIC_HAS_PATTERN,
111   ACOUSTIC_HAS_NO_PATTERN,
112   ACOUSTIC_PATTERN_MISMATCH,
113   VOCAB_ALREADY_LOADED,
114   VOCAB_NOT_LOADED,
115   SYNTAX_GROUP_INVALID,
116   SYNTAX_GROUPS_NOT_COMMON,
117   SYNTAX_GROUP_MISMATCH,
118   SYNTAX_GROUP_NOT_EMPTY,
119   SYNTAX_RULE_INVALID,
120   SYNTAX_RULE_NOT_EMPTY,
121   SYNTAX_NOT_SETUP,
122   SYNTAX_ALREADY_SETUP,
123   UTTERANCE_UNKNOWN,
124   UTTERANCE_INVALID,
125   UTTERANCE_ALREADY_INITIALISED,
126   UTTERANCE_NOT_INITIALISED,
127   UTTERANCE_DIMEN_MISMATCH,
128   MODEL_DIMEN_MISMATCH,
129   PATTERN_NOT_LOADED,
130   PATTERN_ALREADY_LOADED,
131   PATTERN_NOT_SETUP,
132   PATTERN_ALREADY_SETUP,
133   PATTERN_NOT_SETUP_FOR_NOISE,
134   PATTERN_ALREADY_SETUP_FOR_NOISE,
135   ENDIAN_MISMATCH_ERROR,
136   IMAGE_BAD_FILETYPE,
137   IMAGE_BAD_ENDIAN,
138   RECOGNIZER_INPUT_NOT_LOADED,
139   PATTERN_INPUT_NOT_LOADED,
140   ACOUSTIC_INPUT_NOT_LOADED,
141   FRONTEND_INPUT_NOT_LOADED,
142   UNCONFIGURED_WAVE,
143   CONFIGURED_WAVE,
144   UNCONFIGURED_CMS_AND_AGC,
145   CONFIGURED_CMS_AND_AGC,
146   UNATTACHED_CMS_AND_AGC,
147   ATTACHED_CMS_AND_AGC,
148   BAD_CMS_AND_AGC_CONFIGURATION,
149   UNCONFIGURED_FRONTEND,
150   CONFIGURED_FRONTEND,
151   SPEC_FILTER_NOT_CONFIGURED,
152   SPEC_FILTER_CONFIGURED,
153   NONLINEAR_FILTER_NOT_CONFIGURED,
154   NONLINEAR_FILTER_CONFIGURED,
155   MAX_FILTER_POINTS_EXCEEDED,
156   MISMATCHED_BUFF_SIZES,
157   INCORRECT_SAMPLERATE,
158   OCCUPANCY_MISMATCH,
159   UNKNOWN_ARGUMENT,
160   CACHE_NOT_SETUP,
161   CACHE_ALREADY_SETUP,
162   BAD_PHONEME,
163   ANNOTATE_NO_SEGMENTS,
164   ANNOTATE_SEGMENTS_EXIST,
165   ANNOTATE_NO_LABEL,
166   BAD_LABEL,
167   FB_INVALID_STATE,
168   FB_FRAME_INVALID,
169   PIECEWISE_START,
170   WARP_SCALE,
171   NO_WARP,
172   SEGMENTATION_NOT_INIT,
173   SEGMENTATION_INIT,
174   ASSERT_FAILED
175 };
176 
177 /**
178  * Service error.
179  */
180 typedef struct
181 {
182   char *msg;
183   enum CrecException code;
184   int is_fatal;
185 }
186 crecExceptionInfo;
187 
188 #ifdef USE_EXCEPTION_HANDLING
189 
190 typedef struct
191 {
192   int  ca_rtti;
193   enum  CrecException   code;
194   char  *file_where_thrown;
195   int  line_where_thrown;
196   void  *err_object;
197 }
198 crecXceptn;
199 #endif
200 
201 #endif /* _h_duk_err_ */
202