00001 00017 /* 00018 * Copyright (c) 1991-2006 Kawahara Lab., Kyoto University 00019 * Copyright (c) 2000-2005 Shikano Lab., Nara Institute of Science and Technology 00020 * Copyright (c) 2005-2006 Julius project team, Nagoya Institute of Technology, Nagoya Institute of Technology 00021 * All rights reserved 00022 */ 00023 00024 #include <julius.h> 00025 00039 static void 00040 m_errexit() 00041 { 00042 if (module_mode) { 00043 /* disconnect control module */ 00044 if (module_is_connected()) { 00045 module_send(module_sd, "<SYSINFO PROCESS=\"ERREXIT\"/>\n.\n"); 00046 module_disconnect(); 00047 } 00048 } else { 00049 j_printerr("Terminated\n"); 00050 } 00051 exit(1); /* program exit with status 1 */ 00052 } 00053 00067 static void 00068 m_exit() 00069 { 00070 if (module_mode) { 00071 /* disconnect control module */ 00072 if (module_is_connected()) { 00073 module_send(module_sd, "<SYSINFO PROCESS=\"EXIT\"/>\n.\n"); 00074 module_disconnect(); 00075 } 00076 } 00077 exit(0); /* program exit with status 0 */ 00078 } 00079 00080 /* system bootup */ 00094 void 00095 system_bootup() 00096 { 00097 /* set mybmalloc (block memory allocation) parameters first (optional) */ 00098 mybmalloc_set_param(); 00099 00100 /* set error exit function */ 00101 j_error_register_exitfunc(m_errexit); 00102 j_exit_register_exitfunc(m_exit); 00103 00104 /* set default param according to the compile flag */ 00105 if (strmatch(SETUP, "fast")) { 00106 nbest = 1; 00107 enveloped_bestfirst_width = 30; 00108 } else { 00109 nbest = 10; 00110 enveloped_bestfirst_width = 100; 00111 } 00112 00113 }