1 /* m17n-core.h -- header file for the CORE API of the m17n library.
2 Copyright (C) 2003, 2004, 2005, 2006
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., 51 Franklin Street, Fifth Floor,
27 #define M17N_BEGIN_HEADER extern "C" {
28 #define M17N_END_HEADER }
30 #define M17N_BEGIN_HEADER /* do nothing */
31 #define M17N_END_HEADER /* do nothing */
37 * Header file for m17n library.
40 /* (C1) Introduction */
42 /***en @defgroup m17nIntro Introduction */
43 /***ja @defgroup m17nIntro ¤Ï¤¸¤á¤Ë */
46 #if !defined (FOR_DOXYGEN) || defined (DOXYGEN_INTERNAL_MODULE)
48 #define M17NLIB_MAJOR_VERSION 1
49 #define M17NLIB_MINOR_VERSION 3
50 #define M17NLIB_PATCH_LEVEL 5
51 #define M17NLIB_VERSION_NAME "1.3.5"
53 extern void m17n_init_core (void);
54 #define M17N_INIT() m17n_init_core ()
55 extern void m17n_fini_core (void);
56 #define M17N_FINI() m17n_fini_core ()
58 extern int merror_code;
64 /*** @ingroup m17nIntro */
66 @brief Enumeration for the status of the m17n library.
68 The enum #M17NStatus is used as a return value of the function
72 @brief m17n ¥é¥¤¥Ö¥é¥ê¤Î¾õÂÖ¤ò¼¨¤¹Îóµó·¿.
74 Îóµó·¿ #M17NStatus ¤Ï´Ø¿ô m17n_status () ¤ÎÌá¤êÃͤȤ·¤ÆÍѤ¤¤é¤ì¤ë¡£ */
78 /***en No modules is initialized, and all modules are finalized. */
80 /***en Only the modules in CORE API are initialized. */
81 M17N_CORE_INITIALIZED,
82 /***en Only the modules in CORE and SHELL APIs are initialized. */
83 M17N_SHELL_INITIALIZED,
84 /***en All modules are initialized. */
90 extern enum M17NStatus m17n_status (void);
92 /***en @defgroup m17nCore CORE API
93 @brief API provided by libm17n-core.so */
94 /***ja @defgroup m17nCore ¥³¥¢ API
95 @brief libm17n-core.so ¤¬Ä󶡤¹¤ë API */
97 /*** @ingroup m17nCore */
98 /***en @defgroup m17nObject Managed Object
99 @brief Objets managed by the reference count */
100 /***ja @defgroup m17nObject ´ÉÍý²¼¥ª¥Ö¥¸¥§¥¯¥È
101 @brief »²¾È²ó¿ô¤Ç´ÉÍý¤µ¤ì¤ë¥ª¥Ö¥¸¥§¥¯¥È */
104 /*** @ingroup m17nObject */
106 @brief The first member of a managed object.
108 When an application program defines a new structure for managed
109 objects, its first member must be of the type @c struct
110 #M17NObjectHead. Its contents are used by the m17n library, and
111 application programs should never touch them. */
113 @brief ´ÉÍý²¼¥ª¥Ö¥¸¥§¥¯¥È¤ÎºÇ½é¤Î¥á¥ó¥Ð.
115 ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤¬¿·¤·¤¤¹½Â¤ÂΤò´ÉÍý²¼¥ª¥Ö¥¸¥§¥¯¥È¤È¤·¤ÆÄêµÁ¤¹¤ëºÝ¤Ë¤Ï¡¢ºÇ½é¤Î¥á¥ó¥Ð¤Ï
116 @c #M17NObjectHead ¹½Â¤Âη¿¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
117 @c #M17NObjectHead ¤ÎÆâÍÆ¤Ï m17n
118 ¥é¥¤¥Ö¥é¥ê¤¬»ÈÍѤ¹¤ë¤Î¤Ç¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤Ï¿¨¤ì¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ */
127 /* Return a newly allocated managed object. */
128 extern void *m17n_object (int size, void (*freer) (void *));
130 /* Increment the reference count of managed object OBJECT. */
131 extern int m17n_object_ref (void *object);
133 /* Decrement the reference count of managed object OBJECT. */
134 extern int m17n_object_unref (void *object);
136 /*** @ingroup m17nCore */
138 @brief Generic function type.
140 #M17NFunc is a generic function type for setting a function
141 pointer as a value of #MSymbol property or #MPlist. */
146 #M17NFunc ¤ÏÈÆ´Ø¿ô·¿¤Ç¤¢¤ê¡¢´Ø¿ô¥Ý¥¤¥ó¥¿¤ò #MSymbol ¥×¥í¥Ñ¥Æ¥£¤ä
147 #MPlist ¤ÎÃͤȤ·¤ÆÀßÄꤹ¤ëºÝÍѤ¤¤ë¡£ */
152 msymbol_put_func (), msymbol_get_func (),
153 mplist_put_func (), mplist_get_func (). */
155 typedef void (*M17NFunc) (void);
159 /*** @ingroup m17nCore */
161 @brief Wrapper for a generic function type.
163 The macro M17N_FUNC () casts a function to the type #M17NFunc. */
166 @brief ÈÆ´Ø¿ô·¿¤Ø¤Î¥é¥Ã¥Ñ.
168 ¥Þ¥¯¥í M17N_FUNC () ¤Ï´Ø¿ô¤ò #M17NFunc ·¿¤Ø¥¥ã¥¹¥È¤¹¤ë¡£ */
171 #define M17N_FUNC(func) ((M17NFunc) (func))
175 /* (C2) Symbol handling */
177 /*** @ingroup m17nCore */
178 /***en @defgroup m17nSymbol Symbol */
179 /***ja @defgroup m17nSymbol ¥·¥ó¥Ü¥ë */
183 @ingroup m17nSymbol */
185 @brief Type of symbols.
187 The type #MSymbol is for a @e symbol object. Its internal
188 structure is concealed from application programs. */
191 @brief ¥·¥ó¥Ü¥ë¤Î·¿Àë¸À.
193 #MSymbol ¤Ï @e ¥·¥ó¥Ü¥ë (symbol) ¥ª¥Ö¥¸¥§¥¯¥È¤Î·¿¤Ç¤¢¤ë¡£
194 ÆâÉô¹½Â¤¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤«¤é¤Ï¸«¤¨¤Ê¤¤¡£ */
196 typedef struct MSymbolStruct *MSymbol;
200 /* Predefined symbols. */
203 extern MSymbol Mstring;
204 extern MSymbol Msymbol;
205 extern MSymbol Mtext;
206 extern MSymbol Mcharset;
208 /* Return a symbol of name NAME. */
209 extern MSymbol msymbol (const char *name);
211 /* Return a managing key of name NAME. */
212 extern MSymbol msymbol_as_managing_key (const char *name);
214 /* Check if SYMBOL is a managing key. */
215 extern int msymbol_is_managing_key (MSymbol symbol);
217 /* Return a symbol of name NAME if it already exists. */
218 extern MSymbol msymbol_exist (const char *name);
220 /* Return the name of SYMBOL. */
221 extern char *msymbol_name (MSymbol symbol);
223 /* Give SYMBOL KEY property with value VALUE. */
224 extern int msymbol_put (MSymbol symbol, MSymbol key, void *val);
226 /*** Return KEY property value of SYMBOL. */
227 extern void *msymbol_get (MSymbol symbol, MSymbol key);
229 extern int msymbol_put_func (MSymbol symbol, MSymbol key, M17NFunc func);
231 extern M17NFunc msymbol_get_func (MSymbol symbol, MSymbol key);
234 * (2-1) Property List
237 /*** @ingroup m17nCore */
238 /***en @defgroup m17nPlist Property List */
239 /***ja @defgroup m17nPlist ¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È */
243 @ingroup m17nPlist */
245 @brief Type of property list objects.
247 The type #MPlist is for a @e property @e list object. Its internal
248 structure is concealed from application programs. */
251 @brief ¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È¡¦¥ª¥Ö¥¸¥§¥¯¥È¤Î·¿Àë¸À.
253 #MPlist ¤Ï @e ¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È (Property list) ¥ª¥Ö¥¸¥§¥¯¥È¤Î·¿¤Ç¤¢¤ë¡£
254 ÆâÉô¹½Â¤¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤«¤é¤Ï¸«¤¨¤Ê¤¤¡£ */
256 typedef struct MPlist MPlist;
260 extern MSymbol Mplist, Minteger;
262 extern MPlist *mplist ();
264 extern MPlist *mplist_copy (MPlist *plist);
266 extern MPlist *mplist_add (MPlist *plist, MSymbol key, void *val);
268 extern MPlist *mplist_push (MPlist *plist, MSymbol key, void *val);
270 extern void *mplist_pop (MPlist *plist);
272 extern MPlist *mplist_put (MPlist *plist, MSymbol key, void *val);
274 extern void *mplist_get (MPlist *plist, MSymbol key);
276 extern MPlist *mplist_put_func (MPlist *plist, MSymbol key, M17NFunc func);
278 extern M17NFunc mplist_get_func (MPlist *plist, MSymbol key);
280 extern MPlist *mplist_find_by_key (MPlist *plist, MSymbol key);
282 extern MPlist *mplist_find_by_value (MPlist *plist, void *val);
284 extern MPlist *mplist_next (MPlist *plist);
286 extern MPlist *mplist_set (MPlist *plist, MSymbol key, void *val);
288 extern int mplist_length (MPlist *plist);
290 extern MSymbol mplist_key (MPlist *plist);
292 extern void *mplist_value (MPlist *plist);
294 /* (S1) Characters */
297 /*** @ingroup m17nCore */
298 /***en @defgroup m17nCharacter Character */
299 /***ja @defgroup m17nCharacter ʸ»ú */
302 #if !defined (FOR_DOXYGEN) || defined (DOXYGEN_INTERNAL_MODULE)
303 #define MCHAR_MAX 0x3FFFFF
304 /*#define MCHAR_MAX 0x7FFFFFFF*/
307 extern MSymbol Mscript;
308 extern MSymbol Mname;
309 extern MSymbol Mcategory;
310 extern MSymbol Mcombining_class;
311 extern MSymbol Mbidi_category;
312 extern MSymbol Msimple_case_folding;
313 extern MSymbol Mcomplicated_case_folding;
315 extern MSymbol mchar_define_property (const char *name, MSymbol type);
317 extern void *mchar_get_prop (int c, MSymbol key);
319 extern int mchar_put_prop (int c, MSymbol key, void *val);
321 /* (C3) Handling chartable */
323 /*** @ingroup m17nCore */
324 /***en @defgroup m17nChartable Chartable */
325 /***ja @defgroup m17nChartable ʸ»ú¥Æ¡¼¥Ö¥ë */
327 extern MSymbol Mchar_table;
330 @ingroup m17nChartable */
332 @brief Type of chartables.
334 The type #MCharTable is for a @e chartable objects. Its
335 internal structure is concealed from application programs. */
338 @brief ʸ»ú¥Æ¡¼¥Ö¥ë¤Î·¿Àë¸À.
340 #MCharTable ¤Ï @e ʸ»ú¥Æ¡¼¥Ö¥ë (chartable) ¥ª¥Ö¥¸¥§¥¯¥È¤Î·¿¤Ç¤¢¤ë¡£
341 ÆâÉô¹½Â¤¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤«¤é¤Ï¸«¤¨¤Ê¤¤¡£ */
343 typedef struct MCharTable MCharTable;
346 extern MCharTable *mchartable (MSymbol key, void *default_value);
348 extern int mchartable_min_char (MCharTable *table);
350 extern int mchartable_max_char (MCharTable *table);
352 extern void *mchartable_lookup (MCharTable *table, int c);
354 extern int mchartable_set (MCharTable *table, int c, void *val);
356 extern int mchartable_set_range (MCharTable *table, int from, int to,
359 extern int mchartable_map (MCharTable *table, void *ignore,
360 void (*func) (int, int, void *, void *),
363 extern void mchartable_range (MCharTable *table, int *from, int *to);
365 extern MCharTable *mchar_get_prop_table (MSymbol key, MSymbol *type);
368 * (5) Handling M-text.
369 * "M" of M-text stands for:
375 /*** @ingroup m17nCore */
376 /***en @defgroup m17nMtext M-text */
377 /***ja @defgroup m17nMtext M-text */
381 * (5-1) M-text basics
384 /*** @ingroup m17nMtext */
386 @brief Type of @e M-texts.
388 The type #MText is for an @e M-text object. Its internal
389 structure is concealed from application programs. */
392 @brief @e MText ¤Î·¿Àë¸À.
394 #Mtext ¤Ï @e M-text ¥ª¥Ö¥¸¥§¥¯¥È¤Î·¿¤Ç¤¢¤ë¡£
395 ÆâÉô¹½Â¤¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤«¤é¤Ï¸«¤¨¤Ê¤¤¡£
397 @latexonly \IPAlabel{MText} @endlatexonly
398 @latexonly \IPAlabel{MText->MPlist} @endlatexonly */
400 typedef struct MText MText;
404 /*** @ingroup m17nMtext */
406 @brief Enumeration for specifying the format of an M-text.
408 The enum #MTextFormat is used as an argument of the
409 mtext_from_data () function to specify the format of data from
410 which an M-text is created. */
413 @brief M-text ¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤ò»ØÄꤹ¤ëÎóµó·¿.
415 Îóµó·¿ #MTextFormat ¤Ï´Ø¿ô
416 mtext_from_data () ¤Î°ú¿ô¤È¤·¤ÆÍѤ¤¤é¤ì¡¢
417 M-text ¤òÀ¸À®¤¹¤ë¸µ¤È¤Ê¤ë¥Ç¡¼¥¿¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤ò»ØÄꤹ¤ë¡£ */
421 MTEXT_FORMAT_US_ASCII,
423 MTEXT_FORMAT_UTF_16LE,
424 MTEXT_FORMAT_UTF_16BE,
425 MTEXT_FORMAT_UTF_32LE,
426 MTEXT_FORMAT_UTF_32BE,
431 extern MText *mtext ();
433 extern void *mtext_data (MText *mt, enum MTextFormat *fmt, int *nunits,
434 int *pos_idx, int *unit_idx);
438 /***en @name Variables: Default Endian of UTF-16 and UTF-32 */
439 /***ja @name ÊÑ¿ô: UTF-16 ¤È UTF-32 ¤Î¥Ç¥Õ¥©¥ë¥È¤Î¥¨¥ó¥Ç¥£¥¢¥ó */
443 /*** @ingroup m17nMtext */
445 @brief Variable of value MTEXT_FORMAT_UTF_16LE or MTEXT_FORMAT_UTF_16BE.
447 The global variable #MTEXT_FORMAT_UTF_16 is initialized to
448 #MTEXT_FORMAT_UTF_16LE on a "Little Endian" system (storing words
449 with the least significant byte first), and to
450 #MTEXT_FORMAT_UTF_16BE on a "Big Endian" system (storing words
451 with the most significant byte first). */
454 @brief Ãͤ¬ MTEXT_FORMAT_UTF_16LE ¤« MTEXT_FORMAT_UTF_16BE ¤Ç¤¢¤ëÊÑ¿ô
456 Âç°èÊÑ¿ô #MTEXT_FORMAT_UTF_16 ¤Ï¥ê¥È¥ë¡¦¥¨¥ó¥Ç¥£¥¢¥ó¡¦¥·¥¹¥Æ¥à
457 ¡Ê¥ï¡¼¥É¤ò LSB (Least Significant Byte) ¤òÀè¤Ë¤·¤Æ³ÊǼ¡Ë¾å¤Ç¤Ï
458 #MTEXT_FORMAT_UTF_16LE ¤Ë½é´ü²½¤µ¤ì¡¢¥Ó¥Ã¥°¡¦¥¨¥ó¥Ç¥£¥¢¥ó¡¦¥·¥¹¥Æ¥à
459 ¡Ê¥ï¡¼¥É¤ò MSB (Most Significant Byte) ¤òÀè¤Ë¤·¤Æ³ÊǼ¡Ë¾å¤Ç¤Ï
460 #MTEXT_FORMAT_UTF_16BE ¤Ë½é´ü²½¤µ¤ì¤ë¡£ */
464 mtext_from_data () */
466 extern const enum MTextFormat MTEXT_FORMAT_UTF_16;
469 /*** @ingroup m17nMtext */
471 @brief Variable of value MTEXT_FORMAT_UTF_32LE or MTEXT_FORMAT_UTF_32BE.
473 The global variable #MTEXT_FORMAT_UTF_32 is initialized to
474 #MTEXT_FORMAT_UTF_32LE on a "Little Endian" system (storing words
475 with the least significant byte first), and to
476 #MTEXT_FORMAT_UTF_32BE on a "Big Endian" system (storing
477 words with the most significant byte first). */
480 @brief Ãͤ¬ MTEXT_FORMAT_UTF_32LE ¤« MTEXT_FORMAT_UTF_32BE ¤Ç¤¢¤ëÊÑ¿ô
482 Âç°èÊÑ¿ô #MTEXT_FORMAT_UTF_32 ¤Ï¥ê¥È¥ë¡¦¥¨¥ó¥Ç¥£¥¢¥ó¡¦¥·¥¹¥Æ¥à
483 ¡Ê¥ï¡¼¥É¤ò LSB (Least Significant Byte) ¤òÀè¤Ë¤·¤Æ³ÊǼ¡Ë¾å¤Ç¤Ï
484 #MTEXT_FORMAT_UTF_32LE ¤Ë½é´ü²½¤µ¤ì¡¢¥Ó¥Ã¥°¡¦¥¨¥ó¥Ç¥£¥¢¥ó¡¦¥·¥¹¥Æ¥à
485 ¡Ê¥ï¡¼¥É¤ò MSB (Most Significant Byte) ¤òÀè¤Ë¤·¤Æ³ÊǼ¡Ë¾å¤Ç¤Ï
486 #MTEXT_FORMAT_UTF_32BE ¤Ë½é´ü²½¤µ¤ì¤ë¡£ */
490 mtext_from_data () */
492 extern const int MTEXT_FORMAT_UTF_32;
498 extern MText *mtext_from_data (const void *data, int nitems,
499 enum MTextFormat format);
504 extern MSymbol Mlanguage;
507 * (5-2) Functions to manipulate M-texts. They correspond to string
508 * manipulating functions in libc.
509 * In the following functions, mtext_XXX() corresponds to strXXX().
512 extern int mtext_len (MText *mt);
514 extern int mtext_ref_char (MText *mt, int pos);
516 extern int mtext_set_char (MText *mt, int pos, int c);
518 extern MText *mtext_copy (MText *mt1, int pos, MText *mt2, int from, int to);
520 extern int mtext_compare (MText *mt1, int from1, int to1,
521 MText *mt2, int from2, int to2);
523 extern int mtext_case_compare (MText *mt1, int from1, int to1,
524 MText *mt2, int from2, int to2);
526 extern int mtext_character (MText *mt, int from, int to, int c);
528 extern int mtext_del (MText *mt, int from, int to);
530 extern int mtext_ins (MText *mt1, int pos, MText *mt2);
532 extern int mtext_insert (MText *mt1, int pos, MText *mt2, int from, int to);
534 extern int mtext_ins_char (MText *mt, int pos, int c, int n);
536 extern int mtext_replace (MText *mt1, int from1, int to1,
537 MText *mt2, int from2, int to2);
539 extern MText *mtext_cat_char (MText *mt, int c);
541 extern MText *mtext_duplicate (MText *mt, int from, int to);
543 extern MText *mtext_dup (MText *mt);
545 extern MText *mtext_cat (MText *mt1, MText *mt2);
547 extern MText *mtext_ncat (MText *mt1, MText *mt2, int n);
549 extern MText *mtext_cpy (MText *mt1, MText *mt2);
551 extern MText *mtext_ncpy (MText *mt1, MText *mt2, int n);
553 extern int mtext_chr (MText *mt, int c);
555 extern int mtext_rchr (MText *mt, int c);
557 extern int mtext_cmp (MText *mt1, MText *mt2);
559 extern int mtext_ncmp (MText *mt1, MText *mt2, int n);
561 extern int mtext_spn (MText *mt1, MText *mt2);
563 extern int mtext_cspn (MText *mt1, MText *mt2);
565 extern int mtext_pbrk (MText *mt1, MText *mt2);
567 extern int mtext_text (MText *mt1, int pos, MText *mt2);
569 extern int mtext_search (MText *mt1, int from, int to, MText *mt2);
571 extern MText *mtext_tok (MText *mt, MText *delim, int *pos);
573 extern int mtext_casecmp (MText *mt1, MText *mt2);
575 extern int mtext_ncasecmp (MText *mt1, MText *mt2, int n);
577 extern int mtext_lowercase (MText *mt);
579 extern int mtext_titlecase (MText *mt);
581 extern int mtext_uppercase (MText *mt);
584 @brief Enumeration for specifying a set of line breaking option.
586 The enum #MTextLineBreakOption is to control the line breaking
587 algorithm of the function mtext_line_break () by specifying
588 logical-or of the members in the arg @e option. */
590 enum MTextLineBreakOption
592 /***en Specify the legacy support for space character as base for
593 combining marks. See the section 8.3 of UAX#14. */
595 /***en Specify to use space characters for line breaking Korean
597 MTEXT_LBO_KOREAN_SP = 2,
598 /***en Specify to treat characters of ambiguous line-breaking
599 class as of ideographic line-breaking class. */
600 MTEXT_LBO_AI_AS_ID = 4,
604 extern int mtext_line_break (MText *mt, int pos, int option, int *after);
606 /*** @ingroup m17nPlist */
607 extern MPlist *mplist_deserialize (MText *mt);
610 * (5-3) Text properties
613 /*** @ingroup m17nCore */
614 /***en @defgroup m17nTextProperty Text Property */
615 /***ja @defgroup m17nTextProperty ¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£ */
617 /*** @ingroup m17nTextProperty */
619 @brief Flag bits to control text property.
621 The mtext_property () function accepts logical OR of these flag
622 bits as an argument. They control the behaviour of the created
623 text property as described in the documentation of each flag
627 @brief ¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤òÀ©¸æ¤¹¤ë¥Õ¥é¥°¥Ó¥Ã¥È.
629 ´Ø¿ô mtext_property () ¤Ï°Ê²¼¤Î¥Õ¥é¥°¥Ó¥Ã¥È¤ÎÏÀÍý
630 OR ¤ò°ú¿ô¤È¤·¤Æ¤È¤ë¤³¤È¤¬¤Ç¤¤ë¡£
631 ¥Õ¥é¥°¥Ó¥Ã¥È¤ÏÀ¸À®¤µ¤ì¤¿¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤Î¿¶Éñ¤¤¤òÀ©¸æ¤¹¤ë¡£
632 ¾ÜºÙ¤Ï³Æ¥Õ¥é¥°¥Ó¥Ã¥È¤ÎÀâÌÀ¤ò»²¾È¡£*/
634 enum MTextPropertyControl
636 /***en If this flag bit is on, an M-text inserted at the start
637 position or at the middle of the text property inherits the
639 /***ja ¤³¤Î¥Ó¥Ã¥È¤¬ on ¤Ê¤é¤Ð¡¢¤³¤Î¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤Î»Ï¤Þ¤ëÅÀ¤¢¤ë¤¤¤ÏÃæ´Ö¤ËÁÞÆþ¤µ¤ì¤¿
640 M-text ¤Ï¤³¤Î¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤ò·Ñ¾µ¤¹¤ë¡£
642 MTEXTPROP_FRONT_STICKY = 0x01,
644 /***en If this flag bit is on, an M-text inserted at the end
645 position or at the middle of the text property inherits the
647 /***ja ¤³¤Î¥Ó¥Ã¥È¤¬ on ¤Ê¤é¤Ð¡¢¤³¤Î¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤Î½ª¤ï¤ëÅÀ¤¢¤ë¤¤¤ÏÃæ´Ö¤ËÁÞÆþ¤µ¤ì¤¿
648 M-text ¤Ï¤³¤Î¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤ò·Ñ¾µ¤¹¤ë¡£
650 MTEXTPROP_REAR_STICKY = 0x02,
652 /***en If this flag bit is on, the text property is removed if a
653 text in its region is modified. */
654 /***ja ¤³¤Î¥Ó¥Ã¥È¤¬ on ¤Ê¤é¤Ð¡¢¤³¤Î¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤ÎÈÏ°ÏÆâ¤Î¥Æ¥¥¹¥È¤¬Êѹ¹¤µ¤ì¤¿¾ì¹ç¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤Ï¼è¤ê½ü¤«¤ì¤ë¡£ */
655 MTEXTPROP_VOLATILE_WEAK = 0x04,
657 /***en If this flag bit is on, the text property is removed if a
658 text or the other text property in its region is modified. */
659 /***ja ¤³¤Î¥Ó¥Ã¥È¤¬ on ¤Ê¤é¤Ð¡¢¤³¤Î¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤ÎÈÏ°ÏÆâ¤Î¥Æ¥¥¹¥È¤¢¤ë¤¤¤ÏÊ̤Υƥ¥¹¥È¥×¥í¥Ñ¥Æ¥£¤¬Êѹ¹¤µ¤ì¤¿¾ì¹ç¤³¤Î¥Æ¥
660 ¥¹¥È¥×¥í¥Ñ¥Æ¥£¤Ï¼è¤ê½ü¤«¤ì¤ë¡£*/
661 MTEXTPROP_VOLATILE_STRONG = 0x08,
663 /***en If this flag bit is on, the text property is not
664 automatically merged with the others. */
665 /***ja ¤³¤Î¥Ó¥Ã¥È¤¬ on ¤Ê¤é¤Ð¡¢¤³¤Î¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤Ï¾¤Î¥×¥í¥Ñ¥Æ¥£¤È¼«Æ°Åª¤Ë¤Ï¥Þ¡¼¥¸¤µ¤ì¤Ê¤¤¡£ */
666 MTEXTPROP_NO_MERGE = 0x10,
668 MTEXTPROP_CONTROL_MAX = 0x1F
672 extern MSymbol Mtext_prop_serializer;
673 extern MSymbol Mtext_prop_deserializer;
676 /*** @ingroup m17nTextProperty */
678 @brief Type of serializer functions.
680 This is the type of serializer functions. If the key of a symbol
681 property is #Mtext_prop_serializer, the value must be of this
685 mtext_serialize (), #Mtext_prop_serializer
688 @brief ¥·¥ê¥¢¥é¥¤¥¶´Ø¿ô¤Î·¿Àë¸À.
690 ¥·¥ê¥¢¥é¥¤¥¶´Ø¿ô¤Î·¿¤Ç¤¢¤ë¡£ ¤¢¤ë¥·¥ó¥Ü¥ë¤Î¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤¬ @c
691 #Mtext_prop_serializer ¤Ç¤¢¤ë¤È¤¡¢ ÃͤϤ³¤Î·¿¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
694 mtext_serialize (), #Mtext_prop_serializer
697 typedef MPlist *(*MTextPropSerializeFunc) (void *val);
699 /*** @ingroup m17nTextProperty */
701 @brief Type of deserializer functions.
703 This is the type of deserializer functions. If the key of a
704 symbol property is #Mtext_prop_deserializer, the value must be of
708 mtext_deserialize (), #Mtext_prop_deserializer
711 @brief ¥Ç¥·¥ê¥¢¥é¥¤¥¶´Ø¿ô¤Î·¿Àë¸À.
713 ¥Ç¥·¥ê¥¢¥é¥¤¥¶´Ø¿ô¤Î·¿¤Ç¤¢¤ë¡£ ¤¢¤ë¥·¥ó¥Ü¥ë¤Î¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤¬ @c
714 #Msymbol_prop_deserializer ¤Ç¤¢¤ë¤È¤¡¢ ÃͤϤ³¤Î·¿¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
717 Mtext_prop_deserialize (), Mtext_prop_deserializer
719 typedef void *(*MTextPropDeserializeFunc) (MPlist *plist);
721 extern void *mtext_get_prop (MText *mt, int pos, MSymbol key);
723 extern int mtext_get_prop_values (MText *mt, int pos, MSymbol key,
724 void **values, int num);
726 extern int mtext_get_prop_keys (MText *mt, int pos, MSymbol **keys);
728 extern int mtext_put_prop (MText *mt, int from, int to,
729 MSymbol key, void *val);
731 extern int mtext_put_prop_values (MText *mt, int from, int to,
732 MSymbol key, void **values, int num);
734 extern int mtext_push_prop (MText *mt, int from, int to,
735 MSymbol key, void *val);
737 extern int mtext_pop_prop (MText *mt, int from, int to,
740 extern int mtext_prop_range (MText *mt, MSymbol key, int pos,
741 int *from, int *to, int deeper);
745 @ingroup m17nTextProperty */
747 @brief Type of text properties.
749 The type #MTextProperty is for a @e text @e property objects. Its
750 internal structure is concealed from application programs. */
752 @brief @c ¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤Î·¿Àë¸À.
754 #MTextProperty ¤Ï @e ¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£ ¥ª¥Ö¥¸¥§¥¯¥È¤Î·¿¤Ç¤¢¤ë¡£
755 ÆâÉô¹½Â¤¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤«¤é¤Ï¸«¤¨¤Ê¤¤¡£ */
757 typedef struct MTextProperty MTextProperty;
761 extern MTextProperty *mtext_property (MSymbol key, void *val,
764 extern MText *mtext_property_mtext (MTextProperty *prop);
766 extern MSymbol mtext_property_key (MTextProperty *prop);
768 extern void *mtext_property_value (MTextProperty *prop);
770 extern int mtext_property_start (MTextProperty *prop);
772 extern int mtext_property_end (MTextProperty *prop);
774 extern MTextProperty *mtext_get_property (MText *mt, int pos, MSymbol key);
776 extern int mtext_get_properties (MText *mt, int pos, MSymbol key,
777 MTextProperty **props, int num);
779 extern int mtext_attach_property (MText *mt, int from, int to,
780 MTextProperty *prop);
782 extern int mtext_detach_property (MTextProperty *prop);
784 extern int mtext_push_property (MText *mt, int from, int to,
785 MTextProperty *prop);
787 extern MText *mtext_serialize (MText *mt, int from, int to,
788 MPlist *property_list);
790 extern MText *mtext_deserialize (MText *mt);
792 /*** @ingroup m17nCore */
793 /***en @defgroup m17nDatabase Database */
794 /***ja @defgroup m17nDatabase ¥Ç¡¼¥¿¥Ù¡¼¥¹ */
797 /* Directory of an application specific databases. */
798 extern char *mdatabase_dir;
801 @ingroup m17nDatabase */
803 @brief Type of database.
805 The type #MDatabase is for a database object. Its internal
806 structure is concealed from an application program. */
808 @brief ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î·¿Àë¸À.
810 #MDatabase ·¿¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¥ª¥Ö¥¸¥§¥¯¥ÈÍѤι½Â¤ÂΤǤ¢¤ë¡£
811 ÆâÉô¹½Â¤¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤«¤é¤Ï¸«¤¨¤Ê¤¤¡£
814 typedef struct MDatabase MDatabase;
818 /* Look for a data. */
819 extern MDatabase *mdatabase_find (MSymbol tag1, MSymbol tag2,
820 MSymbol tag3, MSymbol tag4);
822 extern MPlist *mdatabase_list (MSymbol tag0, MSymbol tag1,
823 MSymbol tag2, MSymbol tag3);
826 void *mdatabase_load (MDatabase *mdb);
828 /* Get tags of a data. */
829 extern MSymbol *mdatabase_tag (MDatabase *mdb);
832 extern MDatabase *mdatabase_define (MSymbol tag1, MSymbol tag2,
833 MSymbol tag3, MSymbol tag4,
834 void *(*loader) (MSymbol *, void *),
839 #endif /* _M17N_CORE_H_ */