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
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
Copyright (C) 2001 Information-technology Promotion Agency (IPA)
Copyright (C) 2001-2004
National Institute of Advanced Industrial Science and Technology (AIST)
This file is part of the m17n library documentation.
See the end for copying conditions.
-->
<html><head><meta http-equiv="Content-Type" content="text/html;charset="UTF-8">
<title>The m17n Library</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#ffffff">
<a name="top-of-page"></a>
<hr><center>
<a class="qindex" href="index.html">Main Page</a>
<a class="qindex" href="modules.html">Modules</a>
<!-- <a class="qindex" href="classes.html">Alphabetical List</a> -->
<a class="qindex" href="annotated.html">Data Structures</a>
<!-- <a class="qindex" href="files.html">File List</a> -->
<!-- <a class="qindex" href="functions.html">Data Fields</a> -->
<a class="qindex" href="globals.html">Globals</a>
<a class="qindex" href="pages.html">Appendix</a>
</center>
<hr>
<!-- Generated by Doxygen 1.3.9.1 -->
<h1>Error Handling<br>
<small>
[<a class="el" href="group__m17nMisc.html">MISC API</a>]</small>
</h1>Error handling of the m17n library.
<a href="#_details">More...</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Enumerations</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nError.html#ga2">MErrorCode</a> { <br>
<a class="el" href="group__m17nError.html#gga2a2">MERROR_NONE</a>,
<br>
<a class="el" href="group__m17nError.html#gga2a3">MERROR_OBJECT</a>,
<br>
<a class="el" href="group__m17nError.html#gga2a4">MERROR_SYMBOL</a>,
<br>
<a class="el" href="group__m17nError.html#gga2a5">MERROR_MTEXT</a>,
<br>
<a class="el" href="group__m17nError.html#gga2a6">MERROR_TEXTPROP</a>,
<br>
<a class="el" href="group__m17nError.html#gga2a7">MERROR_CHAR</a>,
<br>
<a class="el" href="group__m17nError.html#gga2a8">MERROR_CHARTABLE</a>,
<br>
<a class="el" href="group__m17nError.html#gga2a9">MERROR_CHARSET</a>,
<br>
<a class="el" href="group__m17nError.html#gga2a10">MERROR_CODING</a>,
<br>
<a class="el" href="group__m17nError.html#gga2a11">MERROR_RANGE</a>,
<br>
<a class="el" href="group__m17nError.html#gga2a12">MERROR_LANGUAGE</a>,
<br>
<a class="el" href="group__m17nError.html#gga2a13">MERROR_LOCALE</a>,
<br>
<a class="el" href="group__m17nError.html#gga2a14">MERROR_PLIST</a>,
<br>
<a class="el" href="group__m17nError.html#gga2a15">MERROR_MISC</a>,
<br>
<a class="el" href="group__m17nError.html#gga2a16">MERROR_WIN</a>,
<br>
<a class="el" href="group__m17nError.html#gga2a17">MERROR_X</a>,
<br>
<a class="el" href="group__m17nError.html#gga2a18">MERROR_FRAME</a>,
<br>
<a class="el" href="group__m17nError.html#gga2a19">MERROR_FACE</a>,
<br>
<a class="el" href="group__m17nError.html#gga2a20">MERROR_DRAW</a>,
<br>
<a class="el" href="group__m17nError.html#gga2a21">MERROR_FONT</a>,
<br>
<a class="el" href="group__m17nError.html#gga2a22">MERROR_FONTSET</a>,
<br>
<a class="el" href="group__m17nError.html#gga2a23">MERROR_FONT_OTF</a>,
<br>
<a class="el" href="group__m17nError.html#gga2a24">MERROR_FONT_FT</a>,
<br>
<a class="el" href="group__m17nError.html#gga2a25">MERROR_IM</a>,
<br>
<a class="el" href="group__m17nError.html#gga2a26">MERROR_DB</a>,
<br>
<a class="el" href="group__m17nError.html#gga2a27">MERROR_IO</a>,
<br>
<a class="el" href="group__m17nError.html#gga2a28">MERROR_DEBUG</a>,
<br>
<a class="el" href="group__m17nError.html#gga2a29">MERROR_MEMORY</a>,
<br>
<a class="el" href="group__m17nError.html#gga2a30">MERROR_GD</a>,
<br>
<a class="el" href="group__m17nError.html#gga2a31">MERROR_MAX</a>
<br>
}</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Enumeration for error code of the m17n library. <a href="#ga2">More...</a><br></td></tr>
<tr><td colspan="2"><br><h2>Variables</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nError.html#ga0">merror_code</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">External variable to hold error code of the m17n library. <a href="#ga0"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__m17nError.html#ga1">m17n_memory_full_handler</a> )(enum <a class="el" href="group__m17nError.html#ga2">MErrorCode</a> err)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Memory allocation error handler. <a href="#ga1"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
There are two types of errors that may happen in a function of the m17n library.<p>
The first type is argument errors. When a library function is called with invalid arguments, it returns a value that indicates error and at the same time sets the external variable <a class="el" href="group__m17nError.html#ga0">merror_code</a> to a non-zero integer.<p>
The second type is memory allocation errors. When the required amount of memory is not available on the system, m17n library functions call a function pointed to by the external variable <code>m17n_memory_full_handler</code>. The default value of the variable is a pointer to the default_error_handle() function, which just calls <code> exit()</code>. <hr><h2>Enumeration Type Documentation</h2>
<a class="anchor" name="ga2" doxytag="m17n-misc.h::MErrorCode"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">enum <a class="el" href="group__m17nError.html#ga2">MErrorCode</a> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Enumeration for error code of the m17n library.<p>
When a library function is called with an invalid argument, it sets the external variable <a class="el" href="group__m17nError.html#ga0">merror_code</a> to one of these values. All the error codes are positive integers.<p>
When a memory allocation error happens, the function pointed to by the external variable <a class="el" href="group__m17nError.html#ga1">m17n_memory_full_handler</a> is called with one of these values as an argument. <dl compact><dt><b>Enumeration values: </b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" name="gga2a2" doxytag="MERROR_NONE"></a>MERROR_NONE</em> </td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="gga2a3" doxytag="MERROR_OBJECT"></a>MERROR_OBJECT</em> </td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="gga2a4" doxytag="MERROR_SYMBOL"></a>MERROR_SYMBOL</em> </td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="gga2a5" doxytag="MERROR_MTEXT"></a>MERROR_MTEXT</em> </td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="gga2a6" doxytag="MERROR_TEXTPROP"></a>MERROR_TEXTPROP</em> </td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="gga2a7" doxytag="MERROR_CHAR"></a>MERROR_CHAR</em> </td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="gga2a8" doxytag="MERROR_CHARTABLE"></a>MERROR_CHARTABLE</em> </td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="gga2a9" doxytag="MERROR_CHARSET"></a>MERROR_CHARSET</em> </td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="gga2a10" doxytag="MERROR_CODING"></a>MERROR_CODING</em> </td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="gga2a11" doxytag="MERROR_RANGE"></a>MERROR_RANGE</em> </td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="gga2a12" doxytag="MERROR_LANGUAGE"></a>MERROR_LANGUAGE</em> </td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="gga2a13" doxytag="MERROR_LOCALE"></a>MERROR_LOCALE</em> </td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="gga2a14" doxytag="MERROR_PLIST"></a>MERROR_PLIST</em> </td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="gga2a15" doxytag="MERROR_MISC"></a>MERROR_MISC</em> </td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="gga2a16" doxytag="MERROR_WIN"></a>MERROR_WIN</em> </td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="gga2a17" doxytag="MERROR_X"></a>MERROR_X</em> </td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="gga2a18" doxytag="MERROR_FRAME"></a>MERROR_FRAME</em> </td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="gga2a19" doxytag="MERROR_FACE"></a>MERROR_FACE</em> </td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="gga2a20" doxytag="MERROR_DRAW"></a>MERROR_DRAW</em> </td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="gga2a21" doxytag="MERROR_FONT"></a>MERROR_FONT</em> </td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="gga2a22" doxytag="MERROR_FONTSET"></a>MERROR_FONTSET</em> </td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="gga2a23" doxytag="MERROR_FONT_OTF"></a>MERROR_FONT_OTF</em> </td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="gga2a24" doxytag="MERROR_FONT_FT"></a>MERROR_FONT_FT</em> </td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="gga2a25" doxytag="MERROR_IM"></a>MERROR_IM</em> </td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="gga2a26" doxytag="MERROR_DB"></a>MERROR_DB</em> </td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="gga2a27" doxytag="MERROR_IO"></a>MERROR_IO</em> </td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="gga2a28" doxytag="MERROR_DEBUG"></a>MERROR_DEBUG</em> </td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="gga2a29" doxytag="MERROR_MEMORY"></a>MERROR_MEMORY</em> </td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="gga2a30" doxytag="MERROR_GD"></a>MERROR_GD</em> </td><td>
</td></tr>
<tr><td valign="top"><em><a class="anchor" name="gga2a31" doxytag="MERROR_MAX"></a>MERROR_MAX</em> </td><td>
</td></tr>
</table>
</dl>
</td>
</tr>
</table>
<hr><h2>Variable Documentation</h2>
<a class="anchor" name="ga0" doxytag="m17n-core.c::merror_code"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">int <a class="el" href="group__m17nError.html#ga0">merror_code</a> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
The external variable <a class="el" href="group__m17nError.html#ga0">merror_code</a> holds an error code of the m17n library. When a library function is called with an invalid argument, it sets this variable to one of <code>enum</code> <a class="el" href="group__m17nError.html#ga2">MErrorCode</a>.<p>
This variable initially has the value 0. </td>
</tr>
</table>
<a class="anchor" name="ga1" doxytag="m17n-core.c::m17n_memory_full_handler"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void(* <a class="el" href="group__m17nError.html#ga1">m17n_memory_full_handler</a>)(enum <a class="el" href="group__m17nError.html#ga2">MErrorCode</a> err) </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
The external variable <a class="el" href="group__m17nError.html#ga1">m17n_memory_full_handler</a> holds a pointer to the function to call when a library function failed to allocate memory. <b>err</b> is one of <code>enum</code> <a class="el" href="group__m17nError.html#ga2">MErrorCode</a> indicating in which function the error occurred.<p>
This variable initially points a function that simply calls the <code>exit </code>() function with <b>err</b> as an argument.<p>
An application program that needs a different error handling can change this variable to point a proper function. </td>
</tr>
</table>
<hr>
<center>
<a href="#top-of-page">Top of this page</a><br><br>
<a class="qindex" href="index.html">Main Page</a>
<a class="qindex" href="modules.html">Modules</a>
<!-- <a class="qindex" href="classes.html">Alphabetical List</a> -->
<a class="qindex" href="annotated.html">Data Structures</a>
<!-- <a class="qindex" href="files.html">File List</a> -->
<!-- <a class="qindex" href="functions.html">Data Fields</a> -->
<a class="qindex" href="globals.html">Globals</a>
<a class="qindex" href="pages.html">Appendix</a>
</center>
<hr>
<ADDRESS>
<a href="http://www.m17n.org/m17n-lib/index.html" target="mulewindow"><img src="parrot.png" align=bottom alt="mulemark" border=0></a>
<A HREF="mailto:mule-aist@m17n.org">mule-aist@m17n.org</a>
</ADDRESS>
</body>
</HTML>
<!-- Copyright information
Copyright (C) 2001 Information-technology Promotion Agency (IPA)
Copyright (C) 2001-2004
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, Front-Cover Texts "The m17n library documentation",
and no Back-Cover Texts. A copy of the license is included in the
appendix entitled "GNU Free Documentation License".
-->
|