File: structMConverter.html

package info (click to toggle)
m17n-docs 1.8.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 53,736 kB
  • sloc: javascript: 7,609; sh: 1,256; makefile: 351; ansic: 206
file content (304 lines) | stat: -rw-r--r-- 15,230 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>The m17n Library: MConverter Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">The m17n Library
   &#160;<span id="projectnumber">1.8.4</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-attribs">Data Fields</a>  </div>
  <div class="headertitle">
<div class="title">MConverter Struct Reference<div class="ingroups"><a class="el" href="group__m17nShell.html">SHELL API</a> &raquo; <a class="el" href="group__m17nConv.html">Code Conversion</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>Structure to be used in code conversion.  
 <a href="structMConverter.html#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Data Fields</h2></td></tr>
<tr class="memitem:a1e6ac361d7ec9fc7b8e6471641b8df05"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structMConverter.html#a1e6ac361d7ec9fc7b8e6471641b8df05">lenient</a></td></tr>
<tr class="separator:a1e6ac361d7ec9fc7b8e6471641b8df05"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a25e07110149579b8867e4795b280e868"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structMConverter.html#a25e07110149579b8867e4795b280e868">last_block</a></td></tr>
<tr class="separator:a25e07110149579b8867e4795b280e868"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a99e6c2a37b8f4313960b9006fcf3ddc2"><td class="memItemLeft" align="right" valign="top">unsigned&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structMConverter.html#a99e6c2a37b8f4313960b9006fcf3ddc2">at_most</a></td></tr>
<tr class="separator:a99e6c2a37b8f4313960b9006fcf3ddc2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6b7c87d3ce21346ff6543e7afadab693"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structMConverter.html#a6b7c87d3ce21346ff6543e7afadab693">nchars</a></td></tr>
<tr class="separator:a6b7c87d3ce21346ff6543e7afadab693"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a70d38d3bda2a382e037fbe72f7e46be1"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structMConverter.html#a70d38d3bda2a382e037fbe72f7e46be1">nbytes</a></td></tr>
<tr class="separator:a70d38d3bda2a382e037fbe72f7e46be1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a10d13721702b68bfa1ecf16a877dd640"><td class="memItemLeft" align="right" valign="top">enum <a class="el" href="group__m17nConv.html#gafef05a0f12fd162f58fb750a2f1fbec7">MConversionResult</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structMConverter.html#a10d13721702b68bfa1ecf16a877dd640">result</a></td></tr>
<tr class="separator:a10d13721702b68bfa1ecf16a877dd640"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2d70cef67d5a093fdfb41728d0266c85"><td class="memItemLeft" >union {</td></tr>
<tr class="memitem:a50b665cb80b0e44523f185626ada0561"><td class="memItemLeft" >&#160;&#160;&#160;void *&#160;&#160;&#160;<a class="el" href="structMConverter.html#ad5b2106ccda2ff7146717234462f3653">ptr</a></td></tr>
<tr class="separator:a50b665cb80b0e44523f185626ada0561"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a297f0e3595b5fcdc040a8dfcfe7dba4d"><td class="memItemLeft" >&#160;&#160;&#160;double&#160;&#160;&#160;<a class="el" href="structMConverter.html#a32be6c26106bc428e5517d4b64b8e5cf">dbl</a></td></tr>
<tr class="separator:a297f0e3595b5fcdc040a8dfcfe7dba4d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a758fea4579e60cac3e861d33b8edb3f3"><td class="memItemLeft" >&#160;&#160;&#160;char&#160;&#160;&#160;<a class="el" href="structMConverter.html#ad88907a7a365905704cf01f5da5b7a59">c</a> [256]</td></tr>
<tr class="separator:a758fea4579e60cac3e861d33b8edb3f3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2d70cef67d5a093fdfb41728d0266c85"><td class="memItemLeft" valign="top">}&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structMConverter.html#a2d70cef67d5a093fdfb41728d0266c85">status</a></td></tr>
<tr class="separator:a2d70cef67d5a093fdfb41728d0266c85"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0316d9ad5f6ea12f166b4db59dc5ab3d"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structMConverter.html#a0316d9ad5f6ea12f166b4db59dc5ab3d">internal_info</a></td></tr>
<tr class="separator:a0316d9ad5f6ea12f166b4db59dc5ab3d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Structure to be used in code conversion. </p>
<p>Structure to be used in code conversion. The first three members are to control the conversion. <br  />
 </p>
</div><h2 class="groupheader">Field Documentation</h2>
<a id="a1e6ac361d7ec9fc7b8e6471641b8df05"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1e6ac361d7ec9fc7b8e6471641b8df05">&#9670;&nbsp;</a></span>lenient</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int MConverter::lenient</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Set the value to nonzero if the conversion should be lenient. By default, the conversion is strict (i.e. not lenient).</p>
<p>If the conversion is strict, the converter stops at the first invalid byte (on decoding) or at the first character not supported by the coding system (on encoding). If this happens, <code>MConverter-&gt;result</code> is set to <code>MCONVERSION_RESULT_INVALID_BYTE</code> or <code>MCONVERSION_RESULT_INVALID_CHAR</code> accordingly.</p>
<p>If the conversion is lenient, on decoding, an invalid byte is kept per se, and on encoding, an invalid character is replaced with "&lt;U+XXXX&gt;" (if the character is a Unicode character) or with "&lt;M+XXXXXX&gt;" (otherwise). <br  />
 </p>

</div>
</div>
<a id="a25e07110149579b8867e4795b280e868"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a25e07110149579b8867e4795b280e868">&#9670;&nbsp;</a></span>last_block</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int MConverter::last_block</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Set the value to nonzero before decoding or encoding the last block of the byte sequence or the character sequence respectively. The value influences the conversion as below.</p>
<p>On decoding, in the case that the last few bytes are too short to form a valid byte sequence:</p>
<p>If the value is nonzero, the conversion terminates by error (MCONVERSION_RESULT_INVALID_BYTE) at the first byte of the sequence.</p>
<p>If the value is zero, the conversion terminates successfully. Those bytes are stored in the converter as carryover and are prepended to the byte sequence of the further conversion.</p>
<p>On encoding, in the case that the coding system is context dependent:</p>
<p>If the value is nonzero, the conversion may produce a byte sequence at the end to reset the context to the initial state even if the source characters are zero.</p>
<p>If the value is zero, the conversion never produce such a byte sequence at the end. <br  />
 </p>

</div>
</div>
<a id="a99e6c2a37b8f4313960b9006fcf3ddc2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a99e6c2a37b8f4313960b9006fcf3ddc2">&#9670;&nbsp;</a></span>at_most</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned MConverter::at_most</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>If the value is nonzero, it specifies at most how many characters to convert. <br  />
 </p>

</div>
</div>
<a id="a6b7c87d3ce21346ff6543e7afadab693"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6b7c87d3ce21346ff6543e7afadab693">&#9670;&nbsp;</a></span>nchars</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int MConverter::nchars</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>The following three members are to report the result of the conversion. <br  />
</p>
<p>Number of characters most recently decoded or encoded. <br  />
 </p>

</div>
</div>
<a id="a70d38d3bda2a382e037fbe72f7e46be1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a70d38d3bda2a382e037fbe72f7e46be1">&#9670;&nbsp;</a></span>nbytes</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int MConverter::nbytes</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Number of bytes recently decoded or encoded. <br  />
 </p>

</div>
</div>
<a id="a10d13721702b68bfa1ecf16a877dd640"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a10d13721702b68bfa1ecf16a877dd640">&#9670;&nbsp;</a></span>result</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__m17nConv.html#gafef05a0f12fd162f58fb750a2f1fbec7">MConversionResult</a> MConverter::result</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Result code of the conversion. <br  />
 </p>

</div>
</div>
<a id="ad5b2106ccda2ff7146717234462f3653"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad5b2106ccda2ff7146717234462f3653">&#9670;&nbsp;</a></span>ptr</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void* MConverter::ptr</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a32be6c26106bc428e5517d4b64b8e5cf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a32be6c26106bc428e5517d4b64b8e5cf">&#9670;&nbsp;</a></span>dbl</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double MConverter::dbl</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="ad88907a7a365905704cf01f5da5b7a59"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad88907a7a365905704cf01f5da5b7a59">&#9670;&nbsp;</a></span>c</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char MConverter::c[256]</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a2d70cef67d5a093fdfb41728d0266c85"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2d70cef67d5a093fdfb41728d0266c85">&#9670;&nbsp;</a></span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">union { ... }  MConverter::status</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Various information about the status of code conversion. The contents depend on the type of coding system. It is assured that <code>status</code> is aligned so that any type of casting is safe and at least 256 bytes of memory space can be used. <br  />
 </p>

</div>
</div>
<a id="a0316d9ad5f6ea12f166b4db59dc5ab3d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0316d9ad5f6ea12f166b4db59dc5ab3d">&#9670;&nbsp;</a></span>internal_info</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void* MConverter::internal_info</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This member is for internally use only. An application program should never touch it. <br  />
 </p>

</div>
</div>
</div><!-- contents -->
<hr>
<ADDRESS>
<a href="http://www.m17n.org/m17n-lib-en/index.html" target="mulewindow"><img src="parrot.png" align=bottom alt="m17n-lib Home" border=0></a>
</ADDRESS>
</body>
</HTML>
<!-- Copyright information
Copyright (C) 2001 Information-technology Promotion Agency (IPA)
Copyright (C) 2001-2011
  National Institute of Advanced Industrial Science and Technology (AIST)
This file is part of the m17n library documentation.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with no
Invariant Section, no Front-Cover Texts,
and no Back-Cover Texts.  A copy of the license is included in the
appendix entitled "GNU Free Documentation License".
-->