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 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420
|
<!-- This comment will put IE 6, 7 and 8 in quirks mode -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://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"/>
<title>The m17n Library: Chartable</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.6.3 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Data Structures</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<img id="MSearchSelect" src="search/search.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</div>
</li>
</ul>
</div>
</div>
<div class="contents">
<h1>Chartable<br/>
<small>
[<a class="el" href="group__m17nCore.html">CORE API</a>]</small>
</h1>
<p>Chartable objects and API for them.
<a href="#_details">More...</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Typedefs</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="group__m17nChartable.html#ga241f7150476db7182aecb944b711c546">MCharTable</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nChartable.html#ga241f7150476db7182aecb944b711c546">MCharTable</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Type of chartables. <a href="#ga241f7150476db7182aecb944b711c546"></a><br/></td></tr>
<tr><td colspan="2"><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__m17nChartable.html#ga241f7150476db7182aecb944b711c546">MCharTable</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nChartable.html#gad75c06739d6144b32fee4a85f530e339">mchartable</a> (<a class="el" href="group__m17nSymbol.html#ga0f53a95817f0b5c26442f8e12f89c16d">MSymbol</a> key, void *default_value)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Create a new chartable. <a href="#gad75c06739d6144b32fee4a85f530e339"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nChartable.html#gabafef4ff85d483449fd8d3d2d4121f0b">mchartable_min_char</a> (<a class="el" href="group__m17nChartable.html#ga241f7150476db7182aecb944b711c546">MCharTable</a> *table)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the minimum character whose value is set in a chartabe. <a href="#gabafef4ff85d483449fd8d3d2d4121f0b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nChartable.html#ga8a6c1856bff9f9d60f4ba419ab7ad741">mchartable_max_char</a> (<a class="el" href="group__m17nChartable.html#ga241f7150476db7182aecb944b711c546">MCharTable</a> *table)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the maximum character whose value is set in a chartabe. <a href="#ga8a6c1856bff9f9d60f4ba419ab7ad741"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nChartable.html#ga9f80ddddf110d65848c0156092da3a38">mchartable_lookup</a> (<a class="el" href="group__m17nChartable.html#ga241f7150476db7182aecb944b711c546">MCharTable</a> *table, int c)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the assigned value of a character in a chartable. <a href="#ga9f80ddddf110d65848c0156092da3a38"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nChartable.html#ga398b6ad047423d8846c765d4fe94acd0">mchartable_set</a> (<a class="el" href="group__m17nChartable.html#ga241f7150476db7182aecb944b711c546">MCharTable</a> *table, int c, void *val)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Assign a value to a character in a chartable. <a href="#ga398b6ad047423d8846c765d4fe94acd0"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nChartable.html#ga336b039ca5e3a08513edfcfd7dca8197">mchartable_set_range</a> (<a class="el" href="group__m17nChartable.html#ga241f7150476db7182aecb944b711c546">MCharTable</a> *table, int from, int to, void *val)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Assign a value to the characters in the specified range. <a href="#ga336b039ca5e3a08513edfcfd7dca8197"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nChartable.html#ga4cadbd2cae1d2888caf587242b3d0cb3">mchartable_range</a> (<a class="el" href="group__m17nChartable.html#ga241f7150476db7182aecb944b711c546">MCharTable</a> *table, int *from, int *to)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Search for characters that have non-default value. <a href="#ga4cadbd2cae1d2888caf587242b3d0cb3"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nChartable.html#ga802f22afa9b94c76821288bd50b2bb42">mchartable_map</a> (<a class="el" href="group__m17nChartable.html#ga241f7150476db7182aecb944b711c546">MCharTable</a> *table, void *ignore, void(*func)(int, int, void *, void *), void *func_arg)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Call a function for characters in a chartable. <a href="#ga802f22afa9b94c76821288bd50b2bb42"></a><br/></td></tr>
<tr><td colspan="2"><h2>Variables</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__m17nSymbol.html#ga0f53a95817f0b5c26442f8e12f89c16d">MSymbol</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nChartable.html#ga91e88555aace667aa53a16e5fbb4226c">Mchar_table</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Symbol whose name is "char-table". <a href="#ga91e88555aace667aa53a16e5fbb4226c"></a><br/></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>Chartable objects and API for them. </p>
<p>The m17n library supports enormous number of characters. Thus, if attributes of each character are to be stored in a simple array, such an array would be impractically big. The attributes usually used, however, are often assigned only to a range of characters. Even when all characters have attributes, characters of consecutive character code tend to have the same attribute values.</p>
<p>The m17n library utilizes this tendency to store characters and their attribute values efficiently in an object called <em>Chartable</em>. Although a chartable object is not a simple array, application programs can handle a chartable as if it is an array. Attribute values of a character can be obtained by accessing a Chartable for the attribute with the character code of the specified character.</p>
<p>A chartable is a managed object. </p>
<hr/><h2>Typedef Documentation</h2>
<a class="anchor" id="ga241f7150476db7182aecb944b711c546"></a><!-- doxytag: member="m17n-core.h::MCharTable" ref="ga241f7150476db7182aecb944b711c546" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef struct <a class="el" href="group__m17nChartable.html#ga241f7150476db7182aecb944b711c546">MCharTable</a> <a class="el" href="group__m17nChartable.html#ga241f7150476db7182aecb944b711c546">MCharTable</a></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Type of chartables. </p>
<p>The type <a class="el" href="group__m17nChartable.html#ga241f7150476db7182aecb944b711c546" title="Type of chartables.">MCharTable</a> is for a <em>chartable</em> objects. Its internal structure is concealed from application programs. </p>
</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="gad75c06739d6144b32fee4a85f530e339"></a><!-- doxytag: member="chartab.c::mchartable" ref="gad75c06739d6144b32fee4a85f530e339" args="(MSymbol key, void *default_value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group__m17nChartable.html#ga241f7150476db7182aecb944b711c546">MCharTable</a>* mchartable </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__m17nSymbol.html#ga0f53a95817f0b5c26442f8e12f89c16d">MSymbol</a> </td>
<td class="paramname"> <em>key</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void * </td>
<td class="paramname"> <em>default_value</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Create a new chartable. </p>
<p>The <a class="el" href="group__m17nChartable.html#gad75c06739d6144b32fee4a85f530e339" title="Create a new chartable.">mchartable()</a> function creates a new chartable object with symbol <b>key</b> and the default value <b>default_value</b>. If <b>key</b> is a managing key, the elements of the table (including the default value) are managed objects or NULL.</p>
<dl class="user"><dt><b>Return value:</b></dt><dd>If the operation was successful, <a class="el" href="group__m17nChartable.html#gad75c06739d6144b32fee4a85f530e339" title="Create a new chartable.">mchartable()</a> returns a pointer to the created chartable. Otherwise it returns <code>NULL</code> and assigns an error code to the external variable <a class="el" href="group__m17nError.html#ga995a2e373cfd6a8e5eaca8686b5b0a73" title="External variable to hold error code of the m17n library.">merror_code</a>. </dd></dl>
</div>
</div>
<a class="anchor" id="gabafef4ff85d483449fd8d3d2d4121f0b"></a><!-- doxytag: member="chartab.c::mchartable_min_char" ref="gabafef4ff85d483449fd8d3d2d4121f0b" args="(MCharTable *table)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int mchartable_min_char </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__m17nChartable.html#ga241f7150476db7182aecb944b711c546">MCharTable</a> * </td>
<td class="paramname"> <em>table</em></td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Return the minimum character whose value is set in a chartabe. </p>
<p>The <a class="el" href="group__m17nChartable.html#gabafef4ff85d483449fd8d3d2d4121f0b" title="Return the minimum character whose value is set in a chartabe.">mchartable_min_char()</a> function return the minimum character whose value is set in chartable <b>table</b>. No character is set its value, the function returns -1. </p>
</div>
</div>
<a class="anchor" id="ga8a6c1856bff9f9d60f4ba419ab7ad741"></a><!-- doxytag: member="chartab.c::mchartable_max_char" ref="ga8a6c1856bff9f9d60f4ba419ab7ad741" args="(MCharTable *table)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int mchartable_max_char </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__m17nChartable.html#ga241f7150476db7182aecb944b711c546">MCharTable</a> * </td>
<td class="paramname"> <em>table</em></td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Return the maximum character whose value is set in a chartabe. </p>
<p>The <a class="el" href="group__m17nChartable.html#ga8a6c1856bff9f9d60f4ba419ab7ad741" title="Return the maximum character whose value is set in a chartabe.">mchartable_max_char()</a> function return the maximum character whose value is set in chartable <b>table</b>. No character is set its value, the function returns -1. </p>
</div>
</div>
<a class="anchor" id="ga9f80ddddf110d65848c0156092da3a38"></a><!-- doxytag: member="chartab.c::mchartable_lookup" ref="ga9f80ddddf110d65848c0156092da3a38" args="(MCharTable *table, int c)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void* mchartable_lookup </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__m17nChartable.html#ga241f7150476db7182aecb944b711c546">MCharTable</a> * </td>
<td class="paramname"> <em>table</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"> <em>c</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Return the assigned value of a character in a chartable. </p>
<p>The <a class="el" href="group__m17nChartable.html#ga9f80ddddf110d65848c0156092da3a38" title="Return the assigned value of a character in a chartable.">mchartable_lookup()</a> function returns the value assigned to character <b>c</b> in chartable <b>table</b>. If no value has been set for <b>c</b> explicitly, the default value of <b>table</b> is returned. If <b>c</b> is not a valid character, <a class="el" href="group__m17nChartable.html#ga9f80ddddf110d65848c0156092da3a38" title="Return the assigned value of a character in a chartable.">mchartable_lookup()</a> returns <code>NULL</code> and assigns an error code to the external variable <a class="el" href="group__m17nError.html#ga995a2e373cfd6a8e5eaca8686b5b0a73" title="External variable to hold error code of the m17n library.">merror_code</a>.</p>
<dl class="user"><dt><b>Errors:</b></dt><dd><code>MERROR_CHAR</code> </dd></dl>
<dl class="user"><dt><b>See Also:</b></dt><dd><a class="el" href="group__m17nChartable.html#ga398b6ad047423d8846c765d4fe94acd0" title="Assign a value to a character in a chartable.">mchartable_set()</a> </dd></dl>
</div>
</div>
<a class="anchor" id="ga398b6ad047423d8846c765d4fe94acd0"></a><!-- doxytag: member="chartab.c::mchartable_set" ref="ga398b6ad047423d8846c765d4fe94acd0" args="(MCharTable *table, int c, void *val)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int mchartable_set </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__m17nChartable.html#ga241f7150476db7182aecb944b711c546">MCharTable</a> * </td>
<td class="paramname"> <em>table</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"> <em>c</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void * </td>
<td class="paramname"> <em>val</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Assign a value to a character in a chartable. </p>
<p>The <a class="el" href="group__m17nChartable.html#ga398b6ad047423d8846c765d4fe94acd0" title="Assign a value to a character in a chartable.">mchartable_set()</a> function sets the value of character <b>c</b> in chartable <b>table</b> to <b>val</b>.</p>
<dl class="user"><dt><b>Return value:</b></dt><dd>If the operation was successful, <a class="el" href="group__m17nChartable.html#ga398b6ad047423d8846c765d4fe94acd0" title="Assign a value to a character in a chartable.">mchartable_set()</a> returns 0. Otherwise it returns -1 and assigns an error code to the external variable <a class="el" href="group__m17nError.html#ga995a2e373cfd6a8e5eaca8686b5b0a73" title="External variable to hold error code of the m17n library.">merror_code</a>.</dd></dl>
<dl class="user"><dt><b>Errors:</b></dt><dd><code>MERROR_CHAR</code> </dd></dl>
<dl class="user"><dt><b>See Also:</b></dt><dd><a class="el" href="group__m17nChartable.html#ga9f80ddddf110d65848c0156092da3a38" title="Return the assigned value of a character in a chartable.">mchartable_lookup()</a>, <a class="el" href="group__m17nChartable.html#ga336b039ca5e3a08513edfcfd7dca8197" title="Assign a value to the characters in the specified range.">mchartable_set_range()</a> </dd></dl>
</div>
</div>
<a class="anchor" id="ga336b039ca5e3a08513edfcfd7dca8197"></a><!-- doxytag: member="chartab.c::mchartable_set_range" ref="ga336b039ca5e3a08513edfcfd7dca8197" args="(MCharTable *table, int from, int to, void *val)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int mchartable_set_range </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__m17nChartable.html#ga241f7150476db7182aecb944b711c546">MCharTable</a> * </td>
<td class="paramname"> <em>table</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"> <em>from</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"> <em>to</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void * </td>
<td class="paramname"> <em>val</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Assign a value to the characters in the specified range. </p>
<p>The <a class="el" href="group__m17nChartable.html#ga336b039ca5e3a08513edfcfd7dca8197" title="Assign a value to the characters in the specified range.">mchartable_set_range()</a> function assigns value <b>val</b> to the characters from <b>from</b> to <b>to</b> (both inclusive) in chartable <b>table</b>.</p>
<dl class="user"><dt><b>Return value:</b></dt><dd>If the operation was successful, <a class="el" href="group__m17nChartable.html#ga336b039ca5e3a08513edfcfd7dca8197" title="Assign a value to the characters in the specified range.">mchartable_set_range()</a> returns 0. Otherwise it returns -1 and assigns an error code to the external variable <a class="el" href="group__m17nError.html#ga995a2e373cfd6a8e5eaca8686b5b0a73" title="External variable to hold error code of the m17n library.">merror_code</a>. If <b>from</b> is greater than <b>to</b>, <a class="el" href="group__m17nChartable.html#ga336b039ca5e3a08513edfcfd7dca8197" title="Assign a value to the characters in the specified range.">mchartable_set_range()</a> returns immediately without an error.</dd></dl>
<dl class="user"><dt><b>Errors:</b></dt><dd><code>MERROR_CHAR</code> </dd></dl>
<dl class="user"><dt><b>See Also:</b></dt><dd><a class="el" href="group__m17nChartable.html#ga398b6ad047423d8846c765d4fe94acd0" title="Assign a value to a character in a chartable.">mchartable_set()</a> </dd></dl>
</div>
</div>
<a class="anchor" id="ga4cadbd2cae1d2888caf587242b3d0cb3"></a><!-- doxytag: member="chartab.c::mchartable_range" ref="ga4cadbd2cae1d2888caf587242b3d0cb3" args="(MCharTable *table, int *from, int *to)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void mchartable_range </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__m17nChartable.html#ga241f7150476db7182aecb944b711c546">MCharTable</a> * </td>
<td class="paramname"> <em>table</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"> <em>from</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"> <em>to</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Search for characters that have non-default value. </p>
<p>The <a class="el" href="group__m17nChartable.html#ga4cadbd2cae1d2888caf587242b3d0cb3" title="Search for characters that have non-default value.">mchartable_range()</a> function searches chartable <b>table</b> for the first and the last character codes that do not have the default value of <b>table</b>, and set <b>from</b> and <b>to</b> to them, respectively. If all characters have the default value, both <b>from</b> and <b>to</b> are set to -1. </p>
</div>
</div>
<a class="anchor" id="ga802f22afa9b94c76821288bd50b2bb42"></a><!-- doxytag: member="chartab.c::mchartable_map" ref="ga802f22afa9b94c76821288bd50b2bb42" args="(MCharTable *table, void *ignore, void(*func)(int, int, void *, void *), void *func_arg)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int mchartable_map </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__m17nChartable.html#ga241f7150476db7182aecb944b711c546">MCharTable</a> * </td>
<td class="paramname"> <em>table</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void * </td>
<td class="paramname"> <em>ignore</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void(*)(int, int, void *, void *) </td>
<td class="paramname"> <em>func</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void * </td>
<td class="paramname"> <em>func_arg</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Call a function for characters in a chartable. </p>
<p>The <a class="el" href="group__m17nChartable.html#ga802f22afa9b94c76821288bd50b2bb42" title="Call a function for characters in a chartable.">mchartable_map()</a> function calls function <b>func</b> for characters in chartable <b>table</b>. No function call occurs for characters that have value <b>ignore</b> in <b>table</b>. Comparison of <b>ignore</b> and character value is done with the operator <code>==</code>. Be careful when you use string literals or pointers.</p>
<p>Instead of calling <b>func</b> for each character, <a class="el" href="group__m17nChartable.html#ga802f22afa9b94c76821288bd50b2bb42" title="Call a function for characters in a chartable.">mchartable_map()</a> tries to optimize the number of function calls, i.e. it makes a single function call for a chunk of characters when those consecutive characters have the same value.</p>
<p>No matter how long the character chunk is, <b>func</b> is called with four arguments; <b>from</b>, <b>to</b>, <b>val</b>, and <b>arg</b>. <b>from</b> and <b>to</b> (both inclusive) defines the range of characters that have value <b>val</b>. <b>arg</b> is the same as <b>func_arg</b>.</p>
<dl class="user"><dt><b>Return value:</b></dt><dd>This function always returns 0. </dd></dl>
</div>
</div>
<hr/><h2>Variable Documentation</h2>
<a class="anchor" id="ga91e88555aace667aa53a16e5fbb4226c"></a><!-- doxytag: member="chartab.c::Mchar_table" ref="ga91e88555aace667aa53a16e5fbb4226c" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group__m17nSymbol.html#ga0f53a95817f0b5c26442f8e12f89c16d">MSymbol</a> <a class="el" href="group__m17nChartable.html#ga91e88555aace667aa53a16e5fbb4226c">Mchar_table</a></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Symbol whose name is "char-table". </p>
<p>The symbol <code>Mchar_table</code> has the name <code>"char-table"</code>. </p>
</div>
</div>
</div>
<!--- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Defines</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<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".
-->
|