1 /*---------------------------------------------------------------------------* 2 * par_basi.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 #include <stdlib.h> 21 #include <string.h> 22 #ifndef _RTT 23 #include <stdio.h> 24 #endif 25 26 #ifdef unix 27 #include <unistd.h> 28 #endif 29 #include <assert.h> 30 31 32 #include "simapi.h" 33 #include "portable.h" 34 35 static const char par_basi[] = "$Id: par_basi.c,v 1.3.10.4 2007/10/15 18:06:24 dahan Exp $"; 36 37 38 CA_AcoustInputParams *CA_AllocateAcousticParameters(void) 39 { 40 CA_AcoustInputParams *hAcoustInp = NULL; 41 TRY_CA_EXCEPT 42 43 hAcoustInp = (CA_AcoustInputParams *) CALLOC_CLR(1, 44 sizeof(CA_AcoustInputParams), "ca.hAcoustInp"); 45 46 hAcoustInp->is_loaded = False; 47 hAcoustInp->ca_rtti = CA_ACOUSTIC_PARAMETERS_SIGNATURE; 48 49 BEG_CATCH_CA_EXCEPT; 50 END_CATCH_CA_EXCEPT(hAcoustInp); 51 52 return (hAcoustInp); 53 54 } 55 56 57 void CA_FreeAcousticParameters(CA_AcoustInputParams *hAcoustInp) 58 { 59 TRY_CA_EXCEPT 60 ASSERT(hAcoustInp); 61 FREE((char *)hAcoustInp); 62 return; 63 BEG_CATCH_CA_EXCEPT; 64 END_CATCH_CA_EXCEPT(hAcoustInp); 65 66 } 67 68 69 CA_PatInputParams *CA_AllocatePatternParameters(void) 70 { 71 CA_PatInputParams *hPatInp = NULL; 72 73 TRY_CA_EXCEPT 74 75 hPatInp = (CA_PatInputParams *) CALLOC_CLR(1, 76 sizeof(CA_PatInputParams), "ca.hPatInp"); 77 78 hPatInp->is_loaded = False; 79 hPatInp->ca_rtti = CA_PATTERN_PARAMETERS_SIGNATURE; 80 81 return (hPatInp); 82 BEG_CATCH_CA_EXCEPT; 83 END_CATCH_CA_EXCEPT(hPatInp); 84 85 } 86 87 88 void CA_FreePatternParameters(CA_PatInputParams *hPatInp) 89 { 90 TRY_CA_EXCEPT 91 ASSERT(hPatInp); 92 FREE((char *)hPatInp); 93 return; 94 BEG_CATCH_CA_EXCEPT; 95 END_CATCH_CA_EXCEPT(hPatInp); 96 97 } 98 99 100 CA_RecInputParams *CA_AllocateRecognitionParameters(void) 101 { 102 CA_RecInputParams *hRecInp = NULL; 103 TRY_CA_EXCEPT 104 hRecInp = (CA_RecInputParams *) CALLOC_CLR(1, 105 sizeof(CA_RecInputParams), "ca.hRecInp"); 106 107 if ( hRecInp != NULL ) 108 { 109 hRecInp->is_loaded = False; 110 hRecInp->ca_rtti = CA_RECOGNIZER_PARAMETERS_SIGNATURE; 111 } 112 return (hRecInp); 113 BEG_CATCH_CA_EXCEPT; 114 END_CATCH_CA_EXCEPT(hRecInp); 115 116 } 117 118 119 void CA_FreeRecognitionParameters(CA_RecInputParams *hRecInp) 120 { 121 TRY_CA_EXCEPT 122 ASSERT(hRecInp); 123 FREE((char *)hRecInp); 124 return; 125 BEG_CATCH_CA_EXCEPT; 126 END_CATCH_CA_EXCEPT(hRecInp); 127 128 } 129 130 131