libsent/src/util/charconv.c

説明を見る。
00001 
00024 /*
00025  * Copyright (c) 1991-2006 Kawahara Lab., Kyoto University
00026  * Copyright (c) 2000-2005 Shikano Lab., Nara Institute of Science and Technology
00027  * Copyright (c) 2005-2006 Julius project team, Nagoya Institute of Technology
00028  * All rights reserved
00029  */
00030 
00031 #include <sent/stddefs.h>
00032 
00033 #ifdef CHARACTER_CONVERSION
00034 
00035 static boolean convert_enabled = FALSE; 
00036 
00045 boolean
00046 j_printf_set_charconv(char *fromcode, char *tocode)
00047 {
00048   boolean enabled;
00049   boolean ret;
00050 
00051   /* call environment-specific setup function */
00052 #ifdef HAVE_ICONV
00053   ret = charconv_iconv_setup(fromcode, tocode, &enabled);
00054 #endif
00055 #ifdef USE_LIBJCODE
00056   ret = charconv_libjcode_setup(fromcode, tocode, &enabled);
00057 #endif
00058 #ifdef USE_WIN32_MULTIBYTE
00059   ret = charconv_win32_setup(fromcode, tocode, &enabled);
00060 #endif
00061 
00062   /* store whether conversion should be enabled or not to outer variable */
00063   convert_enabled = enabled;
00064 
00065   /* return the status */
00066   return(ret);
00067 }
00068 
00079 char *
00080 charconv(char *instr, char *outstr, int maxoutlen)
00081 {
00082   char *ret;
00083 
00084   /* if diabled return instr itself */
00085   if (convert_enabled == FALSE) return(instr); /* no conversion */
00086 
00087   /* call environment-specific conversion function */
00088 #ifdef HAVE_ICONV
00089   ret = charconv_iconv(instr, outstr, maxoutlen);
00090 #endif
00091 #ifdef USE_LIBJCODE
00092   ret = charconv_libjcode(instr, outstr, maxoutlen);
00093 #endif
00094 #ifdef USE_WIN32_MULTIBYTE
00095   ret = charconv_win32(instr, outstr, maxoutlen);
00096 #endif
00097 
00098   /* return pointer to the buffer (either instr or outstr) that have the
00099      resulting string */
00100   return(ret);
00101 }
00102 
00103 #endif /* CHARACTER_CONVERSION */

Juliusに対してTue Dec 26 16:19:28 2006に生成されました。  doxygen 1.5.0