author | mkaz |
Wed, 16 Nov 2011 08:44:50 +0900 | |
changeset 713 | 28795f5ebcf6 |
parent 665 | 2484f4d0e39a |
permissions | -rw-r--r-- |
665
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
1 |
/* |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
2 |
Copyright 1990-2008 Sun Microsystems, Inc. All Rights Reserved. |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
3 |
|
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
4 |
Permission is hereby granted, free of charge, to any person obtaining a |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
5 |
copy of this software and associated documentation files (the |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
6 |
"Software"), to deal in the Software without restriction, including |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
7 |
without limitation the rights to use, copy, modify, merge, publish, |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
8 |
distribute, sublicense, and/or sell copies of the Software, and to |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
9 |
permit persons to whom the Software is furnished to do so, subject to |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
10 |
the following conditions: The above copyright notice and this |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
11 |
permission notice shall be included in all copies or substantial |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
12 |
portions of the Software. |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
13 |
|
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
14 |
|
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
15 |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
16 |
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
17 |
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
18 |
IN NO EVENT SHALL THE OPEN GROUP OR SUN MICROSYSTEMS, INC. BE LIABLE |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
19 |
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
20 |
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
21 |
THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE EVEN IF |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
22 |
ADVISED IN ADVANCE OF THE POSSIBILITY OF SUCH DAMAGES. |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
23 |
|
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
24 |
|
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
25 |
Except as contained in this notice, the names of The Open Group and/or |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
26 |
Sun Microsystems, Inc. shall not be used in advertising or otherwise to |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
27 |
promote the sale, use or other dealings in this Software without prior |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
28 |
written authorization from The Open Group and/or Sun Microsystems, |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
29 |
Inc., as applicable. |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
30 |
|
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
31 |
|
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
32 |
X Window System is a trademark of The Open Group |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
33 |
|
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
34 |
OSF/1, OSF/Motif and Motif are registered trademarks, and OSF, the OSF |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
35 |
logo, LBX, X Window System, and Xinerama are trademarks of the Open |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
36 |
Group. All other trademarks and registered trademarks mentioned herein |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
37 |
are the property of their respective owners. No right, title or |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
38 |
interest in or to any trademark, service mark, logo or trade name of |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
39 |
Sun Microsystems, Inc. or its licensors is granted. |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
40 |
|
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
41 |
*/ |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
42 |
|
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
43 |
#include <iiimp.h> |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
44 |
#include "LECustomData.hh" |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
45 |
|
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
46 |
IIIMP_card16 *LECustomData::empty_str = NULL; |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
47 |
iconv_t LECustomData::utf16to8_cd; |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
48 |
bool LECustomData::iconv_init = false; |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
49 |
size_t LECustomData::ICONV_BUF_SIZ = 256; |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
50 |
char *LECustomData::iconv_buf; |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
51 |
int LECustomData::id = 0; |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
52 |
|
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
53 |
LECustomData::LECustomData( |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
54 |
IIIMP_aux_setvalues_v *pauxval |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
55 |
) |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
56 |
{ |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
57 |
id++; |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
58 |
if (empty_str == NULL) { |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
59 |
// initialize static member |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
60 |
empty_str = new IIIMP_card16[1]; |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
61 |
empty_str[0] = 0; |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
62 |
} |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
63 |
if (!iconv_init) { |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
64 |
utf16to8_cd = iconv_open ("UTF-8", "UTF-16"); |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
65 |
if (utf16to8_cd != (iconv_t)-1) { |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
66 |
iconv_buf = new char[ICONV_BUF_SIZ]; |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
67 |
iconv_init = true; |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
68 |
} |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
69 |
} |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
70 |
|
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
71 |
i_vector = new vector<IIIMP_card32>(); |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
72 |
s_vector = new vector<IIIMP_card16 *>(); |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
73 |
|
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
74 |
int int_count = pauxval->integer_value->count; |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
75 |
for (int i = 0; i < int_count; i++) { |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
76 |
i_vector->push_back (pauxval->integer_value->ptr[i]); |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
77 |
} |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
78 |
for (IIIMP_string *p = pauxval->string_value; p; p = p->next) { |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
79 |
if (p->ptr == NULL) { |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
80 |
s_vector->push_back (empty_str); |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
81 |
} else { |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
82 |
IIIMP_card16 *p16 = new IIIMP_card16[p->len + 1]; |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
83 |
memcpy (p16, p->ptr, p->len * 2); |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
84 |
p16[p->len] = 0; |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
85 |
s_vector->push_back (p16); |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
86 |
} |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
87 |
} |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
88 |
} |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
89 |
|
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
90 |
LECustomData::~LECustomData() |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
91 |
{ |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
92 |
vector<IIIMP_card16 *>::iterator itr; |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
93 |
for (itr = s_vector->begin(); itr < s_vector->end(); itr++) { |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
94 |
delete [] *itr; |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
95 |
} |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
96 |
|
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
97 |
delete i_vector; |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
98 |
delete s_vector; |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
99 |
} |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
100 |
|
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
101 |
IMArgList |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
102 |
LECustomData::get_IMArgList () |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
103 |
{ |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
104 |
/* id for (int) is 0, and id for (char *) is 1 */ |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
105 |
IMArgList list = new IMArg[get_IMArg_num()]; |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
106 |
int i = 0; |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
107 |
|
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
108 |
vector<IIIMP_card32>::iterator iit; |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
109 |
|
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
110 |
for (iit = i_vector->begin(); iit < i_vector->end(); iit++) { |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
111 |
IMSetArg(list[i], 0, *iit); |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
112 |
i++; |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
113 |
} |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
114 |
|
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
115 |
vector<IIIMP_card16 *>::iterator sit; |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
116 |
for (sit = s_vector->begin(); sit < s_vector->end(); sit++) { |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
117 |
char *ptr = make_utf8_charstr(*sit); |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
118 |
IMSetArg(list[i], 1, ptr); |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
119 |
i++; |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
120 |
} |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
121 |
|
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
122 |
return list; |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
123 |
} |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
124 |
|
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
125 |
char * |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
126 |
LECustomData::make_utf8_charstr(IIIMP_card16 * utf16) |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
127 |
{ |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
128 |
if (iconv_init) { |
713
28795f5ebcf6
Bug Fix: build error by iconv prototype. 7104417 7103576 (backport of s11u1:712:3ae62904125b)
mkaz
parents:
665
diff
changeset
|
129 |
char *in_buf = (char *)utf16; |
665
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
130 |
size_t in_size = UTFSTR_len (utf16) * 2; |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
131 |
if (in_size * 3 + 1 > ICONV_BUF_SIZ) { |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
132 |
delete iconv_buf; |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
133 |
ICONV_BUF_SIZ = in_size * 3 + 1; |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
134 |
iconv_buf = new char [ICONV_BUF_SIZ]; |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
135 |
} |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
136 |
size_t left = ICONV_BUF_SIZ; |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
137 |
char *out_buf = iconv_buf; |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
138 |
size_t ret = iconv (utf16to8_cd, &in_buf, &in_size, &out_buf, &left); |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
139 |
if (ret != (size_t)-1) { |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
140 |
iconv_buf[ICONV_BUF_SIZ - left] = '\0'; |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
141 |
return strdup (iconv_buf); |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
142 |
} |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
143 |
} |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
144 |
return NULL; |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
145 |
} |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
146 |
|
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
147 |
|
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
148 |
int |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
149 |
LECustomData::get_IMArg_num () |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
150 |
{ |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
151 |
return i_vector->size() + s_vector->size(); |
2484f4d0e39a
eliminated im-sdk tarball and directly integrate iim-sdk src tree
yukie_es
parents:
diff
changeset
|
152 |
} |