1 /* m17n-core.c -- body of the CORE API.
2 Copyright (C) 2003, 2004
3 National Institute of Advanced Industrial Science and Technology (AIST)
4 Registration Number H15PRO112
6 This file is part of the m17n library.
8 The m17n library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public License
10 as published by the Free Software Foundation; either version 2.1 of
11 the License, or (at your option) any later version.
13 The m17n library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
18 You should have received a copy of the GNU Lesser General Public
19 License along with the m17n library; if not, write to the Free
20 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
25 @brief Introduction to the m17n library.
29 The API of the m17n library is divided into these four.
34 It provides basic modules to handle M-texts. They do not require
35 the m17n database. To use this API, an application program must
36 include <m17n-core.h> and be linked by -lm17n-core.
40 It provides modules that utilize the m17n database (code
41 conversion, character property, etc). They load various kinds of
42 data from the database on demand. To use this API, an application
43 program must include <m17n.h> and be linked by -lm17n-core -lm17n.
45 When you use this API, CORE API is also available.
49 It provides GUI modules such as drawing and inputting M-texts on a
50 graphic device. The API itself is independent on a graphic device
51 but most functions require an argument MFrame which is created for
52 a specific type of graphic device. Currently, a null device, X
53 Window System, and an image date (gdImagePtr) of GD library are
54 supported as a graphic device.
56 On a frame of the null device, you can't draw text nor use an
57 input method (but, for instance, the funciton mdraw_glyph_list ()
60 On a frame of the X Window System, you can use the whole GUI API.
62 On a frame of GD library, you can use all drawing API but can't
65 To use this device, an application program must include
66 <m17n-gui.h> and be linked by -lm17n-core -lm17n -lm17n-gui.
68 When you use this API, CORE and SHELL API are also available.
72 It provides miscellaneous functions to support error handling and
73 debugging. This API cannot be used by itself, but with one or
74 more APIs listed above. To use the API, an application program
75 must include <m17n-misc.h> in addition to one of a header file
80 See also the section @ref m17n-config "m17n-config(1)".
82 <em>ENVIRONMENT VARIABLE</em>
84 The m17n library pays attention to these environment variables.
89 Name of a directory that contains data of the m17n database. See
90 @ref m17nDatabase for more details.
94 Environment variables whose name start by "MDEBUG_" controls
95 printing of debug information. See @ref m17nDebug for more
100 <em>API NAMING CONVENTION</em>
102 The library exports functions, variables, macros, and types. All
103 of them start by the letter 'm' or 'M' followed by an object name
104 (e.g. "symbol" and "plist", but "mtext" object is given the name
105 "text" to avoid double 'm' at the head) or a module name
110 <li> functions -- mobject () or mobject_xxx ()
112 They start with 'm' followed by lower case object name. For
113 example, msymbol (), mtext_ref_char (), mdraw_text ().
115 <li> non-symbol variables -- mobject, or mobject_xxx
117 The naming convention is the same as functions (e.g. mface_large).
119 <li> symbol variables -- Mname
121 Variables of type MSymbol start with 'M' followed by their names
122 (e.g. Mlanguage (name is "language"), Miso_2022 (name is
125 <li> macros -- MOBJECT_XXX
127 They start by 'M' followed by upper case object names.
129 <li> types -- MObject or MObjectXxx
131 They start by 'M' followed by capitalized object names (e.g.
132 MConverter, MInputDriver).
139 @addtogroup m17nIntro
140 @brief m17n ¥é¥¤¥Ö¥é¥ê ¥¤¥ó¥È¥í¥À¥¯¥·¥ç¥ó.
144 m17n ¥é¥¤¥Ö¥é¥ê¤Î API ¤Ï°Ê²¼¤Î£´¼ï¤ËʬÎव¤ì¤Æ¤¤¤ë¡£
149 M-text ¤ò°·¤¦¤¿¤á¤Î´ðËÜŪ¤Ê¥â¥¸¥å¡¼¥ë¤òÄ󶡤¹¤ë¡£¤³¤ÎʬÎà¤Î API ¤Ï
150 m17n ¥Ç¡¼¥¿¥Ù¡¼¥¹¤òɬÍפȤ·¤Ê¤¤¡£ÍøÍѤ¹¤ë¤¿¤á¤Ë¤Ï¡¢¥¢¥×¥ê¥±¡¼¥·¥ç
151 ¥ó¥×¥í¥°¥é¥à¤Ï<m17n-core.h> ¤ò include ¤·¡¢ -lm17n-core ¤Ç¥ê¥ó¥¯¤µ
156 m17n ¥Ç¡¼¥¿¥Ù¡¼¥¹¤òÍøÍѤ¹¤ë¥â¥¸¥å¡¼¥ë¡Ê¥³¡¼¥ÉÊÑ´¹¡¢Ê¸»ú¥×¥í¥Ñ¥Æ¥£
157 Åù¡Ë¤òÄ󶡤¹¤ë¡£¥â¥¸¥å¡¼¥ë¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤éɬÍפ˱þ¤¸¤Æ¿Íͤʥǡ¼
158 ¥¿¤ò¥í¡¼¥É¤¹¤ë¡£ÍøÍѤ¹¤ë¤¿¤á¤Ë¤Ï¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤Ï
159 <m17n.h> ¤ò include ¤·¡¢ -lm17n-core -lm17n ¤Ç¥ê¥ó¥¯¤µ¤ì¤Ê¤¯¤Æ¤Ï¤Ê
162 ¤³¤Î API ¤ò»ÈÍѤ¹¤ëºÝ¤Ë¤Ï¥³¥¢ API ¤â»ÈÍѤǤ¤ë¡£
166 M-texts ¤ò¥°¥é¥Õ¥£¥Ã¥¯¥Ç¥Ð¥¤¥¹¾å¤Çɽ¼¨¤·¤¿¤êÆþÎϤ·¤¿¤ê¤¹¤ë¤È¤¤¤Ã¤¿¡¢
167 ¥°¥é¥Õ¥£¥Ã¥¯¥æ¡¼¥¶¥¤¥ó¥¿¥Õ¥§¡¼¥¹¥â¥¸¥å¡¼¥ë¤òÄ󶡤¹¤ë¡£API ¼«ÂΤϥ°
168 ¥é¥Õ¥£¥Ã¥¯¥Ç¥Ð¥¤¥¹¤È¤ÏÆÈΩ¤Ç¤¢¤ë¤¬¡¢Â¿¤¯¤Î´Ø¿ô¤ÏÆÃÄê¤Î¥°¥é¥Õ¥£¥Ã¥¯
169 ¥Ç¥Ð¥¤¥¹¾å¤ËºîÀ®¤µ¤ì¤¿ MFrame ¤ò°ú¿ô¤Ë¼è¤ë¡£¸½»þÅÀ¤Ç¤Ï¡¢¥Ì¥ë¥Ç¥Ð¥¤
170 ¥¹¡¢X ¥¦¥£¥ó¥É¥¦¥·¥¹¥Æ¥à¡¢GD ¥é¥¤¥Ö¥é¥ê¤Î¥¤¥á¡¼¥¸¡ÊgdImagePtr¡Ë¡¢¤¬
171 ¥°¥é¥Õ¥£¥Ã¥¯¥Ç¥Ð¥¤¥¹¤È¤·¤Æ¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¡£
173 ¥Ì¥ë¥Ç¥Ð¥¤¥¹¾å¤Ç¤Ïɽ¼¨¤âÆþÎϤâ¤Ç¤¤Ê¤¤¡Ê¤¿¤À¤·¤¿¤È¤¨¤Ð
174 mdraw_glyph_list () ¤Ê¤É¤Î´Ø¿ô¤Ï»ÈÍѲÄǽ¡Ë¡£
176 X ¥¦¥£¥ó¥É¥¦¥·¥¹¥Æ¥à¾å¤Ç¤Ï¤¹¤Ù¤Æ¤Î GUI API ¤¬»È¤¨¤ë¡£
178 GD ¥é¥¤¥Ö¥é¥ê¤Î¥¤¥á¡¼¥¸¾å¤Ç¤Ï¡¢ÉÁ²èÍѤΠAPI ¤Ï¤¹¤Ù¤Æ»È¤¨¤ë¤¬ÆþÎϤÏ
181 ¤³¤Î¥Ç¥Ð¥¤¥¹¤ò»ÈÍѤ¹¤ë¤¿¤á¤Ë¤Ï¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤Ï
182 <m17n-gui.h> ¤ò include ¤·¡¢-lm17n-core -lm17n -lm17n-gui ¤Ç¥ê¥ó¥¯
183 ¤µ¤ì¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
185 ¤³¤Î API ¤ò»ÈÍѤ¹¤ëºÝ¤Ë¤Ï¡¢¥³¥¢ API ¤È¥·¥§¥ë API ¤â»ÈÍѤǤ¤ë¡£
189 ¥¨¥é¡¼½èÍý¡¢¥Ç¥Ð¥Ã¥°ÍѤΤ½¤Î¾¤Î´Ø¿ô¤òÄ󶡤¹¤ë¡£¤³¤Î API ¤Ï¤½¤ì¤À¤±
190 ¤Ç¤Ï»ÈÍѤǤ¤º¡¢¾åµ¤Î¾¤Î¤â¤Î¤È¶¦¤Ë»È¤¦¡£ÍøÍѤ¹¤ë¤¿¤á¤Ë¤Ï¡¢¾åµ¤Î
191 ¤¤¤º¤ì¤«¤Î include ¥Õ¥¡¥¤¥ë¤Ë²Ã¤¨¤Æ¡¢ <m17n-misc.h> ¤ò include ¤·¤Ê
196 @ref m17n-config "m17n-config(1)" Àá¤â»²¾È¡£
200 m17n ¥é¥¤¥Ö¥é¥ê¤Ï¼¡¤Î´Ä¶ÊÑ¿ô¤ò¹Íθ¤¹¤ë¡£
205 m17n ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥Ç¡¼¥¿¤ò´Þ¤à¥Ç¥£¥ì¥¯¥È¥ê¤Î̾Á°¡£¾ÜºÙ¤Ï@ref
210 "MDEBUG_" ¤Ç»Ï¤Þ¤ë̾Á°¤ò»ý¤Ä´Ä¶ÊÑ¿ô¤Ï¥Ç¥Ð¥Ã¥°¾ðÊó¤òÀ©¸æ¤¹¤ë¡£¾ÜºÙ
211 ¤Ï@ref m17nDebug »²¾È¡£
215 @em API @em ¤Î̿̾µ¬Â§ ¥³¥Þ¥ó¥É
217 ¥é¥¤¥Ö¥é¥ê¤Ï¡¢´Ø¿ô¡¢ÊÑ¿ô¡¢¥Þ¥¯¥í¡¢·¿¤ò export ¤¹¤ë¡£¤½¤ì¤é¤Ï'm' ¤Þ
218 ¤¿¤Ï 'M' ¤Î¤¢¤È¤Ë¥ª¥Ö¥¸¥§¥¯¥È̾("symbol" ¤ä "plist" ¤Ê¤É¡£¤¿¤À¤·
219 "mtext" ¥ª¥Ö¥¸¥§¥¯¥È¤Ï¤Ï¤¸¤á¤Î 'm' ¤Î½ÅÊ£¤òÈò¤±¤ë¤¿¤á "text" ¤òÍÑ
220 ¤¤¤ë¡£) ¤Þ¤¿¤Ï¥â¥¸¥å¡¼¥ë̾(draw, input ¤Ê¤É) ¤ò³¤±¤¿¤â¤Î¤Ç¤¢¤ë¡£
224 <li> ´Ø¿ô -- mobject () ¤Þ¤¿¤Ï mobject_xxx ()
226 'm' ¤Î¤¢¤È¤Ë¾®Ê¸»ú¤Ç¥ª¥Ö¥¸¥§¥¯¥È̾¤¬Â³¤¯¡£¤¿¤È¤¨¤Ð¡¢msymbol (),
227 mtext_ref_char (), mdraw_text () ¤Ê¤É¡£
229 <li> ¥·¥ó¥Ü¥ë¤Ç¤Ê¤¤ÊÑ¿ô -- mobject, ¤Þ¤¿¤Ï mobject_xxx
231 ´Ø¿ô¤ÈƱ¤¸Ì¿Ì¾µ¬Â§¤Ë½¾¤¦¡£(¤¿¤È¤¨¤Ð mface_large)
233 <li> ¥·¥ó¥Ü¥ëÊÑ¿ô -- Mname
235 MSymbol ·¿ÊÑ¿ô¤Ï¡¢'M' ¤Î¸å¤Ë̾Á°¤¬Â³¤¯¡£¤¿¤È¤¨¤Ð Mlanguage (̾Á°¤Ï
236 "language"), Miso_2022 (̾Á°¤Ï"iso-2022")¤Ê¤É¡£
238 <li> ¥Þ¥¯¥í -- MOBJECT_XXX
240 'M' ¤Î¸å¤ËÂçʸ»ú¤Ç¥ª¥Ö¥¸¥§¥¯¥È̾¤¬Â³¤¯¡£
242 <li> ¥¿¥¤¥× -- MObject ¤Þ¤¿¤Ï MObjectXxx
244 'M' ¤Î¸å¤ËÂçʸ»ú¤Ç»Ï¤á¤Æ¥ª¥Ö¥¸¥§¥¯¥È̾¤ò¤¬Â³¤¯¡£ (¤¿¤È¤¨¤Ð
245 MConverter, MInputDriver)
254 The #M17NLIB_MAJOR_VERSION macro gives the major version number
255 of the m17n library. */
258 ¥Þ¥¯¥í #M17NLIB_MAJOR_VERSION ¤Ï m17n ¥é¥¤¥Ö¥é¥ê¤Î¥á¥¸¥ã¡¼¥Ð¡¼¥¸¥ç
261 #define M17NLIB_MAJOR_VERSION
266 The #M17NLIB_MINOR_VERSION macro gives the minor version number
267 of the m17n library. */
270 ¥Þ¥¯¥í #M17NLIB_MINOR_VERSION ¤Ï m17n ¥é¥¤¥Ö¥é¥ê¤Î¥Þ¥¤¥Ê¡¼¥Ð¡¼¥¸¥ç
273 #define M17NLIB_MINOR_VERSION
278 The #M17NLIB_PATCH_LEVEL macro gives the patch level number
279 of the m17n library. */
282 ¥Þ¥¯¥í #M17NLIB_PATCH_LEVEL ¤Ï m17n ¥é¥¤¥Ö¥é¥ê¤Î¥Ñ¥Ã¥Á¥ì¥Ù¥ëÈÖ¹æ¤ò
285 #define M17NLIB_PATCH_LEVEL
290 The #M17NLIB_VERSION_NAME macro gives the version name of the
291 m17n library as a string. */
294 ¥Þ¥¯¥í #M17NLIB_VERSION_NAME ¤Ï m17n ¥é¥¤¥Ö¥é¥ê¤Î¥Ð¡¼¥¸¥ç¥ó̾¤ò
295 ʸ»úÎó¤È¤·¤ÆÍ¿¤¨¤ë¡£ */
297 #define M17NLIB_VERSION_NAME
302 @brief Initialize the m17n library.
304 The macro M17N_INIT () initializes the m17n library. This macro
305 must be called before any m17n functions are used.
307 It is safe to call this macro multiple times, but in that case,
308 the macro M17N_FINI () must be called the same times to free the
311 If the initialization was successful, the external variable
312 #merror_code is set to 0. Otherwise it is set to -1.
315 M17N_INIT (), m17n_status () */
318 @brief m17n ¥é¥¤¥Ö¥é¥ê¤ò½é´ü²½¤¹¤ë.
320 ¥Þ¥¯¥í M17N_INIT () ¤Ï m17n ¥é¥¤¥Ö¥é¥ê¤ò½é´ü²½¤¹¤ë¡£m17n ¤Î´Ø¿ô¤ò
321 ÍøÍѤ¹¤ëÁ°¤Ë¡¢¤³¤Î¥Þ¥¯¥í¤ò¤Þ¤º¸Æ¤Ð¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
323 ³°ÉôÊÑ¿ô #merror_code ¤Ï¡¢½é´ü²½¤¬À®¸ù¤¹¤ì¤Ð 0 ¤Ë¡¢¤½¤¦¤Ç¤Ê¤±¤ì¤Ð
331 @brief Finalize the m17n library.
333 The macro M17N_FINI () finalizes the m17n library. It frees all the
334 memory area used by the m17n library. Once this macro is
335 called, no m17n functions should be used until the
336 macro M17N_INIT () is called again.
338 If the macro M17N_INIT () was called N times, the Nth call of this
339 macro actually free the memory. */
341 @brief m17n ¥é¥¤¥Ö¥é¥ê¤ò½ªÎ»¤¹¤ë.
343 ¥Þ¥¯¥í M17N_FINI () ¤Ï m17n ¥é¥¤¥Ö¥é¥ê¤ò½ªÎ»¤¹¤ë¡£m17n ¥é¥¤¥Ö¥é¥ê
344 ¤¬»È¤Ã¤¿Á´¤Æ¤Î¥á¥â¥êÎΰè¤Ï²òÊü¤µ¤ì¤ë¡£°ìÅÙ¤³¤Î¥Þ¥¯¥í¤¬¸Æ¤Ð¤ì¤¿¤é¡¢
345 ¥Þ¥¯¥í M17N_INIT () ¤¬ºÆÅٸƤФì¤ë¤Þ¤Ç m17n ´Ø¿ô¤Ï»È¤¦¤Ù¤¤Ç¤Ê¤¤¡£
349 #endif /* FOR_DOXYGEN */
354 #if !defined (FOR_DOXYGEN) || defined (DOXYGEN_INTERNAL_MODULE)
355 /*** @addtogroup m17nInternal
361 #include <sys/time.h>
362 #include <sys/resource.h>
365 #include "m17n-core.h"
366 #include "m17n-misc.h"
367 #include "internal.h"
370 default_error_handler (enum MErrorCode err)
375 static struct timeval time_stack[16];
376 static int time_stack_index;
378 static int report_header_printed;
383 int m17n__core_initialized;
384 int m17n__shell_initialized;
385 int m17n__gui_initialized;
388 mdebug__report_object (char *name, M17NObjectArray *array)
390 if (! (mdebug__flag & MDEBUG_FINI))
392 if (! report_header_printed)
394 fprintf (stderr, "%16s %7s %7s %7s\n",
395 "object", "created", "freed", "alive");
396 fprintf (stderr, "%16s %7s %7s %7s\n",
397 "------", "-------", "-----", "-----");
398 report_header_printed = 1;
400 fprintf (stderr, "%16s %7d %7d %7d\n", name,
401 array->used, array->used - array->count, array->count);
404 free (array->objects);
405 array->count = array->used = 0;
410 void *(*mdatabase__finder) (MSymbol tag1, MSymbol tag2,
411 MSymbol tag3, MSymbol tag4);
412 void *(*mdatabase__loader) (void *);
421 gettimeofday (time_stack + time_stack_index++, &tz);
431 mdebug__print_time ()
437 gettimeofday (&tv, &tz);
438 diff = ((tv.tv_sec - time_stack[time_stack_index - 1].tv_sec) * 1000000
439 + (tv.tv_usec - time_stack[time_stack_index - 1].tv_usec));
440 fprintf (stderr, "%8ld ms.", diff);
441 time_stack[time_stack_index - 1] = tv;
444 #define SET_DEBUG_FLAG(env_name, mask) \
446 char *env_value = getenv (env_name); \
448 if (env_value && env_value[0] == '1') \
449 mdebug__flag |= (mask); \
454 mdebug__register_object (M17NObjectArray *array, void *object)
456 if (array->used == 0)
457 MLIST_INIT1 (array, objects, 256);
459 MLIST_APPEND1 (array, objects, object, MERROR_OBJECT);
463 mdebug__unregister_object (M17NObjectArray *array, void *object)
466 if (array->count >= 0)
470 while (i < array->used && array->objects[i] != object) i++;
472 array->objects[i] = NULL;
483 /* The following two are actually not exposed to a user but concealed
484 by the macro M17N_INIT (). */
487 m17n_init_core (void)
489 int mdebug_mask = MDEBUG_INIT;
491 if (m17n__core_initialized++)
494 merror_code = MERROR_NONE;
495 m17n_memory_full_handler = default_error_handler;
498 SET_DEBUG_FLAG ("MDEBUG_INIT", MDEBUG_INIT);
499 SET_DEBUG_FLAG ("MDEBUG_FINI", MDEBUG_FINI);
500 SET_DEBUG_FLAG ("MDEBUG_CHARSET", MDEBUG_CHARSET);
501 SET_DEBUG_FLAG ("MDEBUG_CODING", MDEBUG_CODING);
502 SET_DEBUG_FLAG ("MDEBUG_DATABASE", MDEBUG_DATABASE);
503 SET_DEBUG_FLAG ("MDEBUG_FONT", MDEBUG_FONT);
504 SET_DEBUG_FLAG ("MDEBUG_FONT_FLT", MDEBUG_FONT_FLT);
505 SET_DEBUG_FLAG ("MDEBUG_FONT_OTF", MDEBUG_FONT_OTF);
506 SET_DEBUG_FLAG ("MDEBUG_INPUT", MDEBUG_INPUT);
510 if (msymbol__init () < 0)
512 MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize symbol module."));
513 if (mplist__init () < 0)
515 MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize plist module."));
516 if (mtext__init () < 0)
518 if (mtext__prop_init () < 0)
520 MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize mtext module."));
521 if (mchartable__init () < 0)
523 MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize chartable module."));
525 mdatabase__finder = NULL;
526 mdatabase__loader = NULL;
530 MDEBUG_PRINT_TIME ("INIT", (stderr, " to initialize the core modules."));
535 m17n_fini_core (void)
537 int mdebug_mask = MDEBUG_FINI;
539 if (m17n__core_initialized == 0
540 || --m17n__core_initialized > 0)
545 MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize chartable module."));
547 MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize textprop module."));
549 MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize mtext module."));
551 MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize symbol module."));
553 MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize plist module."));
556 MDEBUG_PRINT_TIME ("FINI", (stderr, " to finalize the core modules."));
558 report_header_printed = 0;
562 #endif /* !FOR_DOXYGEN || DOXYGEN_INTERNAL_MODULE */
565 /*** @addtogroup m17nIntro */
571 @brief Report which part of the m17n library is initialized.
573 The m17n_status () function returns one of these values depending
574 on which part of the m17n library is initialized:
576 #M17N_NOT_INITIALIZED, #M17N_CORE_INITIALIZED,
577 #M17N_SHELL_INITIALIZED, #M17N_GUI_INITIALIZED */
582 return (m17n__gui_initialized ? M17N_GUI_INITIALIZED
583 : m17n__shell_initialized ? M17N_SHELL_INITIALIZED
584 : m17n__core_initialized ? M17N_CORE_INITIALIZED
585 : M17N_NOT_INITIALIZED);
592 @addtogroup m17nObject
593 @brief Managed objects are objects managed by the reference count.
595 There are some types of m17n objects that are managed by their
596 reference count. Those objects are called @e managed @e objects.
597 When created, the reference count of a managed object is
598 initialized to one. The m17n_object_ref () function increments
599 the reference count of a managed object by one, and the
600 m17n_object_unref () function decrements by one. A managed
601 object is automatically freed when its reference count becomes
604 A property whose key is a managing key can have only a managed
605 object as its value. Such functions as msymbol_put () and
606 mplist_put () pay special attention to such a property.
608 In addition to the predefined managed object types, users can
609 define their own managed object types. See the documentation of
610 the m17n_object () for more details. */
612 @addtogroup m17nObject
613 @brief ´ÉÍý²¼¥ª¥Ö¥¸¥§¥¯¥È¤È¤Ï»²¾È¿ô¤Ë¤è¤Ã¤Æ´ÉÍý¤µ¤ì¤Æ¤¤¤ë¥ª¥Ö¥¸¥§¥¯¥È¤Ç¤¢¤ë.
615 m17n ¥ª¥Ö¥¸¥§¥¯¥È¤Î¤¢¤ë·¿¤Î¤â¤Î¤Ï¡¢»²¾È¿ô¤Ë¤è¤Ã¤Æ´ÉÍý¤µ¤ì¤Æ¤¤¤ë¡£
616 ¤½¤ì¤é¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Ï @e ´ÉÍý²¼¥ª¥Ö¥¸¥§¥¯¥È ¤È¸Æ¤Ð¤ì¤ë¡£À¸À®¤µ¤ì
617 ¤¿»þÅÀ¤Ç¤Î»²¾È¿ô¤Ï 0 ¤Ë½é´ü²½¤µ¤ì¤Æ¤¤¤ë¡£´Ø¿ô m17n_object_ref ()
618 ¤Ï´ÉÍý²¼¥ª¥Ö¥¸¥§¥¯¥È¤Î»²¾È¿ô¤ò 1 Áý¤ä¤·¡¢´Ø¿ôm17n_object_unref ()
619 ¤Ï 1 ¸º¤é¤¹¡£»²¾È¿ô¤¬ 0 ¤Ë¤Ê¤Ã¤¿´ÉÍý²¼¥ª¥Ö¥¸¥§¥¯¥È¤Ï¼«Æ°Åª¤Ë²òÊü¤µ
622 ¥¡¼¤¬´ÉÍý¥¡¼¤Ç¤¢¤ë¥×¥í¥Ñ¥Æ¥£¤Ï¡¢ÃͤȤ·¤Æ´ÉÍý²¼¥ª¥Ö¥¸¥§¥¯¥È¤À¤±¤ò
623 ¼è¤ë¡£´Ø¿ô msymbol_put () ¤ä mplist_put () ¤Ê¤É¤Ï¤½¤ì¤é¤Î¥×¥í¥Ñ¥Æ¥£
626 ÄêµÁºÑ¤ß´ÉÍý²¼¥ª¥Ö¥¸¥§¥¯¥È¥¿¥¤¥×¤Î¾¤Ë¡¢¥æ¡¼¥¶¤ÏɬÍפʴÉÍý²¼¥ª¥Ö¥¸¥§
627 ¥¯¥È¥¿¥¤¥×¤ò¼«Ê¬¤ÇÄêµÁ¤¹¤ë¤³¤È¤¬¤Ç¤¤ë¡£¾ÜºÙ¤Ïm17n_object () ¤ÎÀâ
633 @brief Allocate a managed object.
635 The m17n_object () function allocates a new managed object of
636 $SIZE bytes and sets its reference count to 1. $FREER is the
637 function that is used to free the object when the reference count
638 becomes 0. If $FREER is NULL, the object is freed by the free ()
641 The heading bytes of the allocated object is occupied by
642 #M17NObjectHead. That area is reserved for the m17n library and
643 application programs should never touch it.
646 This function returns a newly allocated object.
649 This function never fails. */
652 @brief ´ÉÍý²¼¥ª¥Ö¥¸¥§¥¯¥È¤ò³ä¤êÅö¤Æ¤ë.
654 ´Ø¿ô m17n_object () ¤Ï$SIZE ¥Ð¥¤¥È¤Î¿·¤·¤¤´ÉÍý²¼¥ª¥Ö¥¸¥§¥¯¥È¤ò³ä¤ê
655 Åö¤Æ¡¢¤½¤Î»²¾È¿ô¤ò 1 ¤È¤¹¤ë¡£ $FREER ¤Ï»²¾È¿ô¤¬ 0 ¤Ë¤Ê¤Ã¤¿ºÝ¤Ë¤½¤Î
656 ¥ª¥Ö¥¸¥§¥¯¥È¤ò²òÊü¤¹¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë´Ø¿ô¤Ç¤¢¤ë¡£$FREER ¤¬ NULL¤Ê
657 ¤é¤Ð¡¢¥ª¥Ö¥¸¥§¥¯¥È¤Ï´Ø¿ô free () ¤Ë¤è¤Ã¤Æ²òÊü¤µ¤ì¤ë¡£
659 ³ä¤êÅö¤Æ¤é¤ì¤¿¥ª¥Ö¥¸¥§¥¯¥ÈËÁƬ¤Î¥Ð¥¤¥È¤Ï¡¢#M17NObjectHead ¤¬Àê¤á¤ë¡£
660 ¤³¤ÎÎΰè¤Ï m17n ¥é¥¤¥Ö¥é¥ê¤¬»ÈÍѤ¹¤ë¤Î¤Ç¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é
661 ¥à¤Ï¿¨¤ì¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
664 ¤³¤Î´Ø¿ô¤Ï¿·¤·¤¯³ä¤êÅö¤Æ¤é¤ì¤¿¥ª¥Ö¥¸¥§¥¯¥È¤òÊÖ¤¹¡£
667 ¤³¤Î´Ø¿ô¤Ï¼ºÇÔ¤·¤Ê¤¤¡£ */
680 free (((MYStruct *) obj)->mem2);
685 my_func (MText *mt, MSymbol key, int num, char *str)
687 MYStruct *st = m17n_object (sizeof (MYStruct), my_freer);
690 st->mem2 = strdup (str);
691 /* KEY must be a managing key. */
692 mtext_put_prop (mt, 0, mtext_len (mt), key, st);
693 /* This sets the reference count of ST back to 1. */
694 m17n_object_unref (st);
699 m17n_object (int size, void (*freer) (void *))
701 M17NObject *obj = malloc (size);
704 obj->u.freer = freer;
711 @brief Increment the reference count of a managed object.
713 The m17n_object_ref () function increments the reference count of
714 the managed object pointed to by $OBJECT.
717 This function returns the resulting reference count if it fits in
718 a 16-bit unsigned integer (i.e. less than 0x10000). Otherwise, it
722 This function never fails. */
724 @brief ´ÉÍý²¼¥ª¥Ö¥¸¥§¥¯¥È¤Î»²¾È¿ô¤ò 1 Áý¤ä¤¹.
726 ´Ø¿ô m17n_object_ref () ¤Ï $OBJECT ¤Ç»Ø¤µ¤ì¤ë´ÉÍý²¼¥ª¥Ö¥¸¥§¥¯¥È¤Î
730 ¤³¤Î´Ø¿ô¤Ï¡¢Áý¤ä¤·¤¿»²¾È¿ô¤¬ 16 ¥Ó¥Ã¥È¤ÎÉä¹æ̵¤·À°¿ôÃÍ(¤¹¤Ê¤ï¤Á
731 0x10000 ̤Ëþ)¤Ë¤ª¤µ¤Þ¤ì¤Ð¡¢¤½¤ì¤òÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð -1 ¤òÊÖ¤¹¡£
734 ¤³¤Î´Ø¿ô¤Ï¼ºÇÔ¤·¤Ê¤¤¡£ */
737 m17n_object_ref (void *object)
739 M17NObject *obj = (M17NObject *) object;
740 M17NObjectRecord *record;
743 if (! obj->ref_count_extended)
745 if (++obj->ref_count)
746 return (int) obj->ref_count;
747 MSTRUCT_MALLOC (record, MERROR_OBJECT);
748 record->freer = obj->u.freer;
749 MLIST_INIT1 (record, counts, 1);
750 MLIST_APPEND1 (record, counts, 0, MERROR_OBJECT);
751 obj->u.record = record;
752 obj->ref_count_extended = 1;
755 record = obj->u.record;
757 count = record->counts;
758 while (*count == 0xFFFFFFFF)
761 if (*count == 0xFFFFFFFF)
762 MLIST_APPEND1 (record, counts, 0, MERROR_OBJECT);
769 @brief Decrement the reference count of a managed object.
771 The m17n_object_unref () function decrements the reference count
772 of the managed object pointed to by $OBJECT. When the reference
773 count becomes zero, the object is freed by its freer function.
776 This function returns the resulting reference count if it fits in
777 a 16-bit unsigned integer (i.e. less than 0x10000). Otherwise, it
778 returns -1. Thus, the return value zero means that $OBJECT is
782 This function never fails. */
784 @brief ´ÉÍý²¼¥ª¥Ö¥¸¥§¥¯¥È¤Î»²¾È¿ô¤ò 1 ¸º¤é¤¹.
786 ´Ø¿ô m17n_object_unref () ¤Ï $OBJECT ¤Ç»Ø¤µ¤ì¤ë´ÉÍý²¼¥ª¥Ö¥¸¥§¥¯¥È
787 ¤Î»²¾È¿ô¤ò 1 ¸º¤é¤¹¡£»²¾È¿ô¤¬ 0 ¤Ë¤Ê¤ì¤Ð¡¢¥ª¥Ö¥¸¥§¥¯¥È¤Ï²òÊü´Ø¿ô¤Ë
791 ¤³¤Î´Ø¿ô¤Ï¡¢¸º¤é¤·¤¿»²¾È¿ô¤¬ 16 ¥Ó¥Ã¥È¤ÎÉä¹æ̵¤·À°¿ôÃÍ(¤¹¤Ê¤ï¤Á
792 0x10000 ̤Ëþ)¤Ë¤ª¤µ¤Þ¤ì¤Ð¡¢¤½¤ì¤òÊÖ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð -1 ¤òÊÖ¤¹¡£
793 ¤Ä¤Þ¤ê¡¢0 ¤¬Ê֤äÆÍ褿¾ì¹ç¤Ï$OBJECT ¤Ï²òÊü¤µ¤ì¤Æ¤¤¤ë¡£
796 ¤³¤Î´Ø¿ô¤Ï¼ºÇÔ¤·¤Ê¤¤¡£ */
798 m17n_object_unref (void *object)
800 M17NObject *obj = (M17NObject *) object;
801 M17NObjectRecord *record;
804 if (! obj->ref_count_extended)
806 if (! --obj->ref_count)
809 (obj->u.freer) (object);
814 return (int) obj->ref_count;
817 record = obj->u.record;
818 count = record->counts;
820 *(count++) = 0xFFFFFFFF;
822 if (! record->counts[0])
824 obj->ref_count_extended = 0;
826 obj->u.freer = record->freer;
827 MLIST_FREE1 (record, counts);
838 @addtogroup m17nError Error handling
839 @brief Error handling of the m17n library.
841 There are two types of errors that may happen in a function of
844 The first type is argument errors. When a library function is
845 called with invalid arguments, it returns a value that indicates
846 error and at the same time sets the external variable #merror_code
847 to a non-zero integer.
849 The second type is memory allocation errors. When the required
850 amount of memory is not available on the system, m17n library
851 functions call a function pointed to by the external variable @c
852 m17n_memory_full_handler. The default value of the variable is a
853 pointer to the default_error_handle () function, which just calls
854 <tt> exit ()</tt>. */
857 @addtogroup m17nError ¥¨¥é¡¼½èÍý
858 @brief m17n ¥é¥¤¥Ö¥é¥ê¤Î¥¨¥é¡¼½èÍý.
860 m17n ¥é¥¤¥Ö¥é¥ê¤Î´Ø¿ô¤Ç¤Ï¡¢£²¤Ä¤Î¼ïÎà¤Î¥¨¥é¡¼¤¬µ¯¤³¤êÆÀ¤ë¡£
862 °ì¤Ä¤Ï°ú¿ô¤Î¥¨¥é¡¼¤Ç¤¢¤ë¡£¥é¥¤¥Ö¥é¥ê¤Î´Ø¿ô¤¬ÂÅÅö¤Ç¤Ê¤¤°ú¿ô¤È¤È¤â¤Ë
863 ¸Æ¤Ð¤ì¤¿¾ì¹ç¡¢¤½¤Î´Ø¿ô¤Ï¥¨¥é¡¼¤ò°ÕÌ£¤¹¤ëÃͤòÊÖ¤·¡¢Æ±»þ¤Ë³°ÉôÊÑ¿ô
864 #merror_code ¤Ë¥¼¥í¤Ç¤Ê¤¤À°¿ô¤ò¥»¥Ã¥È¤¹¤ë¡£
866 ¤â¤¦°ì¤Ä¤Î¼ïÎà¤Ï¥á¥â¥ê³äÅö¤Æ¥¨¥é¡¼¤Ç¤¢¤ë¡£¥·¥¹¥Æ¥à¤¬É¬ÍפÊÎ̤Υá¥â
867 ¥ê¤ò³äÅö¤Æ¤ë¤³¤È¤¬¤Ç¤¤Ê¤¤¾ì¹ç¡¢¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Ï³°ÉôÊÑ¿ô @c
868 m17n_memory_full_handler ¤¬»Ø¤¹´Ø¿ô¤ò¸Æ¤Ö¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢´Ø¿ô
869 default_error_handle () ¤ò»Ø¤·¤Æ¤ª¤ê¡¢¤³¤Î´Ø¿ô¤Ïñ¤Ë <tt>exit
878 @brief External variable to hold error code of the m17n library.
880 The external variable #merror_code holds an error code of the
881 m17n library. When a library function is called with an invalid
882 argument, it sets this variable to one of @c enum #MErrorCode.
884 This variable initially has the value 0. */
887 @brief m17n ¥é¥¤¥Ö¥é¥ê¤Î¥¨¥é¡¼¥³¡¼¥É¤òÊÝ»ý¤¹¤ë³°ÉôÊÑ¿ô.
889 ³°ÉôÊÑ¿ô #merror_code ¤Ï¡¢m17n ¥é¥¤¥Ö¥é¥ê¤Î¥¨¥é¡¼¥³¡¼¥É¤òÊÝ»ý¤¹¤ë¡£
890 ¥é¥¤¥Ö¥é¥ê´Ø¿ô¤¬ÂÅÅö¤Ç¤Ê¤¤°ú¿ô¤È¤È¤â¤Ë¸Æ¤Ð¤ì¤¿ºÝ¤Ë¤Ï¡¢¤³¤ÎÊÑ¿ô¤ò
891 @c enum #MErrorCode ¤Î°ì¤Ä¤Ë¥»¥Ã¥È¤¹¤ë¡£
893 ¤³¤ÎÊÑ¿ô¤Î½é´üÃÍ¤Ï 0 ¤Ç¤¢¤ë¡£ */
895 enum MErrorCode merror_code;
900 @brief Memory allocation error handler.
902 The external variable #m17n_memory_full_handler holds a pointer
903 to the function to call when a library function failed to allocate
904 memory. $ERR is one of @c enum #MErrorCode indicating in which
905 function the error occurred.
907 This variable initially points a function that simply calls the
908 <tt>exit </tt>() function with $ERR as an argument.
910 An application program that needs a different error handling can
911 change this variable to point a proper function. */
914 @brief ¥á¥â¥ê³äÅö¤Æ¥¨¥é¡¼¥Ï¥ó¥É¥é.
916 ÊÑ¿ô #m17n_memory_full_handler ¤Ï¡¢¥é¥¤¥Ö¥é¥ê´Ø¿ô¤¬¥á¥â¥ê³äÅö¤Æ
917 ¤Ë¼ºÇÔ¤·¤¿ºÝ¤Ë¸Æ¤Ö¤Ù¤´Ø¿ô¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£$ERR ¤Ï @c enum
918 #MErrorCode ¤Î¤¤¤º¤ì¤«¤Ç¤¢¤ê¡¢¤É¤Î¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Ç¥¨¥é¡¼¤¬µ¯¤Ã¤¿
923 ½é´üÀßÄê¤Ç¤Ï¡¢¤³¤ÎÊÑ¿ô¤Ïñ¤Ë <tt>exit ()</tt> ¤ò $ERR ¤ò°ú¿ô¤È¤·¤Æ
924 ¸Æ¤Ö´Ø¿ô¤ò»Ø¤·¤Æ¤¤¤ë¡£
926 ¤³¤ì¤È¤Ï°Û¤Ê¤ë¥¨¥é¡¼½èÍý¤òɬÍפȤ¹¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¡¢¤³¤ÎÊÑ¿ô¤ò
927 ŬÅö¤Ê´Ø¿ô¤ËÀßÄꤹ¤ë¤³¤È¤Ç¡¢ÌÜŪ¤òãÀ®¤Ç¤¤ë¡£ */
929 void (*m17n_memory_full_handler) (enum MErrorCode err);
936 @addtogroup m17nDebug
937 @brief Support for m17n library users to debug their programs.
939 The m17n library provides the following facilities to support the
940 library users to debug their programs.
944 <li> Environment variables to control printing of various
949 <li> MDEBUG_INIT -- If set to 1, print information about the
950 library initialization on the call of M17N_INIT ().
952 <li> MDEBUG_FINI -- If set to 1, print counts of objects that are
953 not yet freed on the call of M17N_FINI ().
955 <li> MDEBUG_CHARSET -- If set to 1, print information about
956 charsets being loaded from the m17n database.
958 <li> MDEBUG_CODING -- If set to 1, print information about coding
959 systems being loaded from the m17n database.
961 <li> MDEBUG_DATABASE -- If set to 1, print information about
962 data being loaded from the m17n database.
964 <li> MDEBUG_FONT -- If set to 1, print information about fonts
965 being selected and opened.
967 <li> MDEBUG_FONT_FLT -- If set to 1, print information about which
968 command of Font Layout Table are being executed.
970 <li> MDEBUG_FONT_OTF -- If set to 1, print information about which
971 feature of OpenType Layout Table are being executed.
973 <li> MDEBUG_INPUT -- If set to 1, print information about how an
974 input method is running.
976 <li> MDEBUG_ALL -- Setting this variable to 1 is equivalent to
977 setting all the above variables to 1.
981 <li> Functions to print various objects in a human readable way.
982 See the documentation of mdebug_dump_XXXX () functions.
984 <li> The hook function called on an error. See the documentation
990 @addtogroup m17nDebug
991 @brief m17n ¥é¥¤¥Ö¥é¥ê¥æ¡¼¥¶¤Î¤¿¤á¤Î¥×¥í¥°¥é¥à¥Ç¥Ð¥Ã¥°¥µ¥Ý¡¼¥È.
993 m17n ¥é¥¤¥Ö¥é¥ê¤Ï¡¢¤½¤Î¥æ¡¼¥¶¤¬¼«Ê¬¤Î¥×¥í¥°¥é¥à¤ò¥Ç¥Ð¥Ã¥°¤¹¤ë¤¿¤á
994 ¤Ë¡¢°Ê²¼¤Îµ¡Ç½¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£
998 <li> ¤µ¤Þ¤¶¤Þ¤Ê¾ðÊó¤Î¥×¥ê¥ó¥È¤òÀ©¸æ¤¹¤ë´Ä¶ÊÑ¿ô¡£
1002 <li> MDEBUG_INIT -- 1 ¤Ê¤é¤Ð¡¢M17N_INIT () ¤¬¸Æ¤Ð¤ì¤¿»þÅÀ¤Ç¡¢¥é¥¤
1003 ¥Ö¥é¥ê¤Î½é´ü²½¤Ë´Ø¤¹¤ë¾ðÊó¤ò¥×¥ê¥ó¥È¤¹¤ë¡£
1005 <li> MDEBUG_FINI -- 1 ¤Ê¤é¤Ð¡¢M17N_FINI () ¤¬¸Æ¤Ð¤ì¤¿»þÅÀ¤Ç¡¢¤Þ¤À
1006 ²òÊü¤µ¤ì¤Æ¤¤¤Ê¤¤¥ª¥Ö¥¸¥§¥¯¥È¤Î»²¾È¿ô¤ò¥×¥ê¥ó¥È¤¹¤ë¡£
1008 <li> MDEBUG_CHARSET -- 1 ¤Ê¤é¤Ð¡¢m17n ¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤é¥í¡¼¥É¤µ¤ì¤¿
1009 ʸ»ú¥»¥Ã¥È¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤ò¥×¥ê¥ó¥È¤¹¤ë¡£
1011 <li> MDEBUG_CODING -- 1 ¤Ê¤é¤Ð¡¢m17n ¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤é¥í¡¼¥É¤µ¤ì¤¿
1012 ¥³¡¼¥É·Ï¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤ò¥×¥ê¥ó¥È¤¹¤ë¡£
1014 <li> MDEBUG_DATABASE -- 1 ¤Ê¤é¤Ð¡¢m17n ¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤é¥í¡¼¥É¤µ¤ì
1015 ¤¿¥Ç¡¼¥¿¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤ò¥×¥ê¥ó¥È¤¹¤ë¡£
1017 <li> MDEBUG_FONT -- 1 ¤Ê¤é¤Ð¡¢ÁªÂò¤µ¤ì¤Æ¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Õ¥©¥ó¥È¤Ë¤Ä
1018 ¤¤¤Æ¤Î¾ðÊó¤ò¥×¥ê¥ó¥È¤¹¤ë¡£
1020 <li> MDEBUG_FONT_FLT -- 1 ¤Ê¤é¤Ð¡¢Font Layout Table ¤Î¤É¤Î¥³¥Þ¥ó¥É
1021 ¤¬¼Â¹ÔÃ椫¤Ë¤Ä¤¤¤Æ¤Î¤ò¥×¥ê¥ó¥È¤¹¤ë¡£
1023 <li> MDEBUG_FONT_OTF -- 1 ¤Ê¤é¤Ð¡¢OpenType Layout Table ¤Î¤É¤Î°À
1024 ¤¬¼Â¹ÔÃ椫¤Ë¤Ä¤¤¤Æ¤Î¤ò¥×¥ê¥ó¥È¤¹¤ë¡£
1026 <li> MDEBUG_INPUT -- 1 ¤Ê¤é¤Ð¡¢¼Â¹ÔÃæ¤ÎÆþÎϥ᥽¥Ã¥É¤Î¾õÂÖ¤ËÉÕ¤¤¤Æ
1027 ¤Î¾ðÊó¤ò¥×¥ê¥ó¥È¤¹¤ë¡£
1029 <li> MDEBUG_ALL -- 1 ¤Ê¤é¤Ð¡¢¾åµ¤¹¤Ù¤Æ¤ÎÊÑ¿ô¤ò 1 ¤Ë¤·¤¿¤Î¤ÈƱ¤¸¸ú
1034 <li> ¼ï¡¹¤Î¥ª¥Ö¥¸¥§¥¯¥È¤ò¿Í´Ö¤Ë²ÄÆɤʷÁ¤Ç¥×¥ê¥ó¥È¤¹¤ë´Ø¿ô¡£¾ÜºÙ¤Ï
1035 ´Ø¿ô mdebug_dump_XXXX () ¤ÎÀâÌÀ»²¾È¡£
1037 <li> ¥¨¥é¡¼È¯À¸»þ¤Ë¸Æ¤Ð¤ì¤ë¥Õ¥Ã¥¯´Ø¿ô¡£mdebug_hook () ¤ÎÀâÌÀ»²¾È¡£
1047 @brief Hook function called on an error.
1049 The mdebug_hook () function is called when an error happens. It
1050 returns -1 without doing anything. It is useful to set a break
1051 point on this function in a debugger. */
1053 @brief ¥¨¥é¡¼¤ÎºÝ¤Ë¸Æ¤Ð¤ì¤ë¥Õ¥Ã¥¯´Ø¿ô.
1055 ´Ø¿ô mdebug_hook () ¤Ï¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿ºÝ¤Ë¸Æ¤Ð¤ì¡¢²¿¤â¤»¤º¤Ë-1 ¤ò
1056 ÊÖ¤¹¡£¥Ç¥Ð¥Ã¥¬Æâ¤Ç¥Ö¥ì¡¼¥¯¥Ý¥¤¥ó¥È¤òÀßÄꤹ¤ë¤¿¤á¤ËÍѤ¤¤ë¤³¤È¤¬¤Ç¤