1 /*---------------------------------------------------------------------------* 2 * ESR_ReturnCode.c * 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 22 #include "ESR_ReturnCode.h" 23 ESR_rc2str(const ESR_ReturnCode rc)24const LCHAR* ESR_rc2str(const ESR_ReturnCode rc) 25 { 26 switch (rc) { 27 case ESR_SUCCESS: return L("ESR_SUCCESS"); 28 case ESR_CONTINUE_PROCESSING: return L("ESR_CONTINUE_PROCESSING"); 29 case ESR_FATAL_ERROR: return L("ESR_FATAL_ERROR"); 30 case ESR_BUFFER_OVERFLOW: return L("ESR_BUFFER_OVERFLOW"); 31 case ESR_OPEN_ERROR: return L("ESR_OPEN_ERROR"); 32 case ESR_ALREADY_OPEN: return L("ESR_ALREADY_OPEN"); 33 case ESR_CLOSE_ERROR: return L("ESR_CLOSE_ERROR"); 34 case ESR_ALREADY_CLOSED: return L("ESR_ALREADY_CLOSED"); 35 case ESR_READ_ERROR: return L("ESR_READ_ERROR"); 36 case ESR_WRITE_ERROR: return L("ESR_WRITE_ERROR"); 37 case ESR_FLUSH_ERROR: return L("ESR_FLUSH_ERROR"); 38 case ESR_SEEK_ERROR: return L("ESR_SEEK_ERROR"); 39 case ESR_OUT_OF_MEMORY: return L("ESR_OUT_OF_MEMORY"); 40 case ESR_ARGUMENT_OUT_OF_BOUNDS: return L("ESR_ARGUMENT_OUT_OF_BOUNDS"); 41 case ESR_NO_MATCH_ERROR: return L("ESR_NO_MATCH_ERROR"); 42 case ESR_INVALID_ARGUMENT: return L("ESR_INVALID_ARGUMENT"); 43 case ESR_NOT_SUPPORTED: return L("ESR_NOT_SUPPORTED"); 44 case ESR_INVALID_STATE: return L("ESR_INVALID_STATE"); 45 case ESR_THREAD_CREATION_ERROR: return L("ESR_THREAD_CREATION_ERROR"); 46 case ESR_IDENTIFIER_COLLISION: return L("ESR_IDENTIFIER_COLLISION"); 47 case ESR_TIMED_OUT: return L("ESR_TIMED_OUT"); 48 case ESR_INVALID_RESULT_TYPE: return L("ESR_INVALID_RESULT_TYPE"); 49 case ESR_NOT_IMPLEMENTED: return L("ESR_NOT_IMPLEMENTED"); 50 case ESR_CONNECTION_RESET_BY_PEER: return L("ESR_CONNECTION_RESET_BY_PEER"); 51 case ESR_PROCESS_CREATE_ERROR: return L("ESR_PROCESS_CREATE_ERROR"); 52 case ESR_TTS_NO_ENGINE: return L("ESR_TTS_NO_ENGINE"); 53 case ESR_MUTEX_CREATION_ERROR: return L("ESR_MUTEX_CREATION_ERROR"); 54 case ESR_DEADLOCK: return L("ESR_DEADLOCK"); 55 }; 56 return L("invalid return code"); 57 } 58