[uim-commit] r827 - in trunk: uim xim

ekato at freedesktop.org ekato at freedesktop.org
Fri Apr 22 21:52:37 PDT 2005


Author: ekato
Date: 2005-04-22 21:52:35 -0700 (Fri, 22 Apr 2005)
New Revision: 827

Modified:
   trunk/uim/uim-func.c
   trunk/uim/uim.h
   trunk/xim/compose.cpp
   trunk/xim/locale.cpp
Log:
* uim/uim.h : Export uim_iconv_open().
* uim/uim-func.c : Ditto.
* xim/compose.cpp : Use uim_iconv_open().
* xim/locale.cpp : Ditto.


Modified: trunk/uim/uim-func.c
===================================================================
--- trunk/uim/uim-func.c	2005-04-22 07:38:34 UTC (rev 826)
+++ trunk/uim/uim-func.c	2005-04-23 04:52:35 UTC (rev 827)
@@ -43,7 +43,6 @@
 #define MAX_LENGTH_OF_INT_AS_STR (((sizeof(int) == 4) ? sizeof("-2147483648") : sizeof("-9223372036854775808")) - sizeof((char)'\0'))
 
 static const char **uim_get_encoding_alias(const char *encoding);
-static iconv_t uim_iconv_open(const char *tocode, const char *fromcode);
 
 char *uim_return_str;
 char *uim_return_str_list[10]; /* XXX */
@@ -161,7 +160,7 @@
     return 1;
 
   /* TODO cache the result */
-  ic = uim_iconv_open(tocode, fromcode);
+  ic = (iconv_t)uim_iconv_open(tocode, fromcode);
   if (ic == (iconv_t)-1) {
     return 0;
   }
@@ -183,7 +182,7 @@
   return NULL;
 }
 
-static iconv_t
+void *
 uim_iconv_open(const char *tocode, const char *fromcode) {
   iconv_t cd = (iconv_t)-1;
   int i, j;
@@ -224,7 +223,7 @@
     free(alias_tocode);
   if (alias_fromcode_alloced)
     free(alias_fromcode);
-  return cd;
+  return (void *)cd;
 }
 
 void *
@@ -235,7 +234,7 @@
   if (check_encoding_equivalence(tocode, fromcode))
     return NULL;
 
-  ic = uim_iconv_open(tocode, fromcode);
+  ic = (iconv_t)uim_iconv_open(tocode, fromcode);
   if (ic == (iconv_t)-1) {
     /* since iconv_t is not explicit pointer, use 0 instead of NULL */
     ic = (iconv_t)0;

Modified: trunk/uim/uim.h
===================================================================
--- trunk/uim/uim.h	2005-04-22 07:38:34 UTC (rev 826)
+++ trunk/uim/uim.h	2005-04-23 04:52:35 UTC (rev 827)
@@ -581,6 +581,9 @@
 /* an uim_code_converter implementation using iconv */
 extern struct uim_code_converter *uim_iconv;
 
+/* uim's iconv_open wrapper */
+void *uim_iconv_open(const char *tocode, const char *fromcode);
+
 #ifdef __cplusplus
 }
 #endif

Modified: trunk/xim/compose.cpp
===================================================================
--- trunk/xim/compose.cpp	2005-04-22 07:38:34 UTC (rev 826)
+++ trunk/xim/compose.cpp	2005-04-23 04:52:35 UTC (rev 827)
@@ -1162,7 +1162,7 @@
     size_t ret_val;
     iconv_t cd;
 
-    cd = iconv_open("UTF-8", enc);
+    cd = (iconv_t)uim_iconv_open("UTF-8", enc);
     if (cd == (iconv_t)-1) {
 	perror("error in iconv_open");
 	utf8[0] = '\0';

Modified: trunk/xim/locale.cpp
===================================================================
--- trunk/xim/locale.cpp	2005-04-22 07:38:34 UTC (rev 826)
+++ trunk/xim/locale.cpp	2005-04-23 04:52:35 UTC (rev 827)
@@ -206,7 +206,7 @@
     size_t inbytesleft, outbytesleft;
     size_t ret_val;
     
-    cd = iconv_open(enc, "UTF-8");
+    cd = (iconv_t)uim_iconv_open(enc, "UTF-8");
     if (cd == (iconv_t)-1) {
 	perror("error in iconv_open");
 	return NULL;



More information about the Uim-commit mailing list