1 /*---------------------------------------------------------------------------* 2 * frontpar.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 22 #if defined(__cplusplus) && defined(_MSC_VER) 23 extern "C" 24 { 25 #include <string.h> 26 } 27 #else 28 #include <string.h> 29 #endif 30 31 #ifndef _RTT 32 #include <stdio.h> 33 #endif 34 35 #ifdef unix 36 #include <unistd.h> 37 #endif 38 #include <assert.h> 39 40 #include "duk_args.h" 41 #include "frontapi.h" 42 #include "portable.h" 43 44 45 #ifdef SET_RCSID 46 static const char *rcsid = 0 ? (const char *) &rcsid : 47 "$Id: frontpar.c,v 1.4.10.6 2007/10/15 18:06:24 dahan Exp $"; 48 #endif 49 50 int load_up_parameter_list(arg_info *arglist, CA_FrontendInputParams *frontArgs); 51 52 53 CA_FrontendInputParams *CA_AllocateFrontendParameters(void) 54 { 55 CA_FrontendInputParams *frontArgs = NULL; 56 TRY_CA_EXCEPT 57 frontArgs = (CA_FrontendInputParams *) CALLOC_CLR(1, 58 sizeof(CA_FrontendInputParams), "cfront.hFrontArgs"); 59 60 frontArgs->is_loaded = False; 61 frontArgs->ca_rtti = CA_FRONTEND_PARAMETERS_SIGNATURE; 62 return (frontArgs); 63 BEG_CATCH_CA_EXCEPT; 64 END_CATCH_CA_EXCEPT(frontArgs); 65 } 66 67 void CA_FreeFrontendParameters(CA_FrontendInputParams *frontArgs) 68 { 69 TRY_CA_EXCEPT 70 ASSERT(frontArgs); 71 72 FREE((char *)frontArgs); 73 74 BEG_CATCH_CA_EXCEPT; 75 END_CATCH_CA_EXCEPT(frontArgs); 76 } 77