1 /* m17n-core.h -- header file for the CORE API of the m17n library.
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
32 * Header file for m17n library.
35 /* (C1) Introduction */
37 /***en @defgroup m17nIntro Introduction */
38 /***ja @defgroup m17nIntro ¤Ï¤¸¤á¤Ë */
41 #if !defined (FOR_DOXYGEN) || defined (DOXYGEN_INTERNAL_MODULE)
43 #define M17NLIB_MAJOR_VERSION 1
44 #define M17NLIB_MINOR_VERSION 3
45 #define M17NLIB_PATCH_LEVEL 0
46 #define M17NLIB_VERSION_NAME "1.3.0"
48 extern void m17n_init_core (void);
49 #define M17N_INIT() m17n_init_core ()
50 extern void m17n_fini_core (void);
51 #define M17N_FINI() m17n_fini_core ()
57 /*** @ingroup m17nIntro */
59 @brief Enumeration for the status of the m17n library.
61 The enum #M17NStatus is used as a return value of the function
65 @brief m17n ¥é¥¤¥Ö¥é¥ê¤Î¾õÂÖ¤ò¼¨¤¹Îóµó·¿.
67 Îóµó·¿ #M17NStatus ¤Ï´Ø¿ô m17n_status () ¤ÎÌá¤êÃͤȤ·¤ÆÍѤ¤¤é¤ì¤ë¡£ */
71 /***en No modules is initialized, and all modules are finalized. */
73 /***en Only the modules in CORE API are initialized. */
74 M17N_CORE_INITIALIZED,
75 /***en Only the modules in CORE and SHELL APIs are initialized. */
76 M17N_SHELL_INITIALIZED,
77 /***en All modules are initialized. */
83 extern enum M17NStatus m17n_status (void);
85 /***en @defgroup m17nCore CORE API */
86 /***ja @defgroup m17nCore ¥³¥¢ API */
88 /*** @ingroup m17nCore */
89 /***en @defgroup m17nObject Managed Object */
90 /***ja @defgroup m17nObject ´ÉÍý²¼¥ª¥Ö¥¸¥§¥¯¥È */
93 /*** @ingroup m17nObject */
95 @brief The first member of a managed object.
97 When an application program defines a new structure for managed
98 objects, its first member must be of the type @c struct
99 #M17NObjectHead. Its contents are used by the m17n library, and
100 application programs should never touch them. */
102 @brief ´ÉÍý²¼¥ª¥Ö¥¸¥§¥¯¥È¤ÎºÇ½é¤Î¥á¥ó¥Ð.
104 ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤¬¿·¤·¤¤¹½Â¤ÂΤò´ÉÍý²¼¥ª¥Ö¥¸¥§¥¯¥È¤È¤·¤ÆÄêµÁ¤¹¤ëºÝ¤Ë¤Ï¡¢ºÇ½é¤Î¥á¥ó¥Ð¤Ï
105 @c #M17NObjectHead ¹½Â¤Âη¿¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
106 @c #M17NObjectHead ¤ÎÆâÍÆ¤Ï m17n
107 ¥é¥¤¥Ö¥é¥ê¤¬»ÈÍѤ¹¤ë¤Î¤Ç¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤Ï¿¨¤ì¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ */
116 /* Return a newly allocated managed object. */
117 extern void *m17n_object (int size, void (*freer) (void *));
119 /* Increment the reference count of managed object OBJECT. */
120 extern int m17n_object_ref (void *object);
122 /* Decrement the reference count of managed object OBJECT. */
123 extern int m17n_object_unref (void *object);
127 /* (C2) Symbol handling */
129 /*** @ingroup m17nCore */
130 /***en @defgroup m17nSymbol Symbol */
131 /***ja @defgroup m17nSymbol ¥·¥ó¥Ü¥ë */
135 @ingroup m17nSymbol */
137 @brief Type of symbols.
139 The type #MSymbol is for a @e symbol object. Its internal
140 structure is concealed from application programs. */
143 @brief ¥·¥ó¥Ü¥ë¤Î·¿Àë¸À.
145 #MSymbol ¤Ï @e ¥·¥ó¥Ü¥ë (symbol) ¥ª¥Ö¥¸¥§¥¯¥È¤Î·¿¤Ç¤¢¤ë¡£
146 ÆâÉô¹½Â¤¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤«¤é¤Ï¸«¤¨¤Ê¤¤¡£ */
148 typedef struct MSymbolStruct *MSymbol;
152 /* Predefined symbols. */
155 extern MSymbol Mstring;
156 extern MSymbol Msymbol;
157 extern MSymbol Mtext;
159 /* Return a symbol of name NAME. */
160 extern MSymbol msymbol (const char *name);
162 /* Return a managing key of name NAME. */
163 extern MSymbol msymbol_as_managing_key (const char *name);
165 /* Check if SYMBOL is a managing key. */
166 extern int msymbol_is_managing_key (MSymbol symbol);
168 /* Return a symbol of name NAME if it already exists. */
169 extern MSymbol msymbol_exist (const char *name);
171 /* Return the name of SYMBOL. */
172 extern char *msymbol_name (MSymbol symbol);
174 /* Give SYMBOL KEY property with value VALUE. */
175 extern int msymbol_put (MSymbol symbol, MSymbol key, void *val);
177 /*** Return KEY property value of SYMBOL. */
178 extern void *msymbol_get (MSymbol symbol, MSymbol key);
181 * (2-1) Property List
184 /*** @ingroup m17nCore */
185 /***en @defgroup m17nPlist Property List */
186 /***ja @defgroup m17nPlist ¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È */
190 @ingroup m17nPlist */
192 @brief Type of property list objects.
194 The type #MPlist is for a @e property @e list object. Its internal
195 structure is concealed from application programs. */
198 @brief ¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È¡¦¥ª¥Ö¥¸¥§¥¯¥È¤Î·¿Àë¸À.
200 #MPlist ¤Ï @e ¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È (Property list) ¥ª¥Ö¥¸¥§¥¯¥È¤Î·¿¤Ç¤¢¤ë¡£
201 ÆâÉô¹½Â¤¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤«¤é¤Ï¸«¤¨¤Ê¤¤¡£ */
203 typedef struct MPlist MPlist;
207 extern MSymbol Mplist, Minteger;
209 extern MPlist *mplist ();
211 extern MPlist *mplist_copy (MPlist *plist);
213 extern MPlist *mplist_add (MPlist *plist, MSymbol key, void *val);
215 extern MPlist *mplist_push (MPlist *plist, MSymbol key, void *val);
217 extern void *mplist_pop (MPlist *plist);
219 extern MPlist *mplist_put (MPlist *plist, MSymbol key, void *val);
221 extern MPlist *mplist_conc (MPlist *plist, MPlist *tail);
223 extern void *mplist_get (MPlist *plist, MSymbol key);
225 extern MPlist *mplist_find_by_key (MPlist *plist, MSymbol key);
227 extern MPlist *mplist_find_by_value (MPlist *plist, void *val);
229 extern MPlist *mplist_next (MPlist *plist);
231 extern MPlist *mplist_set (MPlist *plist, MSymbol key, void *val);
233 extern int mplist_length (MPlist *plist);
235 extern MSymbol mplist_key (MPlist *plist);
237 extern void *mplist_value (MPlist *plist);
239 /* (S1) Characters */
242 /*** @ingroup m17nCore */
243 /***en @defgroup m17nCharacter Character */
244 /***ja @defgroup m17nCharacter ʸ»ú */
247 #if !defined (FOR_DOXYGEN) || defined (DOXYGEN_INTERNAL_MODULE)
248 #define MCHAR_MAX 0x3FFFFF
249 /*#define MCHAR_MAX 0x7FFFFFFF*/
252 extern MSymbol Mscript;
253 extern MSymbol Mname;
254 extern MSymbol Mcategory;
255 extern MSymbol Mcombining_class;
256 extern MSymbol Mbidi_category;
257 extern MSymbol Msimple_case_folding;
258 extern MSymbol Mcomplicated_case_folding;
260 extern MSymbol mchar_define_property (const char *name, MSymbol type);
262 extern void *mchar_get_prop (int c, MSymbol key);
264 extern int mchar_put_prop (int c, MSymbol key, void *val);
266 /* (C3) Handling chartable */
268 /*** @ingroup m17nCore */
269 /***en @defgroup m17nChartable Chartable */
270 /***ja @defgroup m17nChartable ʸ»ú¥Æ¡¼¥Ö¥ë */
272 extern MSymbol Mchar_table;
275 @ingroup m17nChartable */
277 @brief Type of chartables.
279 The type #MCharTable is for a @e chartable objects. Its
280 internal structure is concealed from application programs. */
283 @brief ʸ»ú¥Æ¡¼¥Ö¥ë¤Î·¿Àë¸À.
285 #MCharTable ¤Ï @e ʸ»ú¥Æ¡¼¥Ö¥ë (chartable) ¥ª¥Ö¥¸¥§¥¯¥È¤Î·¿¤Ç¤¢¤ë¡£
286 ÆâÉô¹½Â¤¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤«¤é¤Ï¸«¤¨¤Ê¤¤¡£ */
288 typedef struct MCharTable MCharTable;
291 extern MCharTable *mchartable (MSymbol key, void *default_value);
293 extern void *mchartable_lookup (MCharTable *table, int c);
295 extern int mchartable_set (MCharTable *table, int c, void *val);
297 extern int mchartable_set_range (MCharTable *table, int from, int to,
300 extern int mchartable_map (MCharTable *table, void *ignore,
301 void (*func) (int, int, void *, void *),
304 extern void mchartable_range (MCharTable *table, int *from, int *to);
306 extern MCharTable *mchar_get_prop_table (MSymbol key, MSymbol *type);
309 * (5) Handling M-text.
310 * "M" of M-text stands for:
316 /*** @ingroup m17nCore */
317 /***en @defgroup m17nMtext M-text */
318 /***ja @defgroup m17nMtext M-text */
322 * (5-1) M-text basics
325 /*** @ingroup m17nMtext */
327 @brief Type of @e M-texts.
329 The type #MText is for an @e M-text object. Its internal
330 structure is concealed from application programs. */
333 @brief @e MText ¤Î·¿Àë¸À.
335 #Mtext ¤Ï @e M-text ¥ª¥Ö¥¸¥§¥¯¥È¤Î·¿¤Ç¤¢¤ë¡£
336 ÆâÉô¹½Â¤¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤«¤é¤Ï¸«¤¨¤Ê¤¤¡£
338 @latexonly \IPAlabel{MText} @endlatexonly
339 @latexonly \IPAlabel{MText->MPlist} @endlatexonly */
341 typedef struct MText MText;
345 /*** @ingroup m17nMtext */
347 @brief Enumeration for specifying the format of an M-text.
349 The enum #MTextFormat is used as an argument of the
350 mtext_from_data () function to specify the format of data from
351 which an M-text is created. */
354 @brief M-text ¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤ò»ØÄꤹ¤ëÎóµó·¿.
356 Îóµó·¿ #MTextFormat ¤Ï´Ø¿ô
357 mtext_from_data () ¤Î°ú¿ô¤È¤·¤ÆÍѤ¤¤é¤ì¡¢
358 M-text ¤òÀ¸À®¤¹¤ë¸µ¤È¤Ê¤ë¥Ç¡¼¥¿¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤ò»ØÄꤹ¤ë¡£ */
362 MTEXT_FORMAT_US_ASCII,
364 MTEXT_FORMAT_UTF_16LE,
365 MTEXT_FORMAT_UTF_16BE,
366 MTEXT_FORMAT_UTF_32LE,
367 MTEXT_FORMAT_UTF_32BE,
372 extern MText *mtext ();
374 extern void *mtext_data (MText *mt, enum MTextFormat *fmt, int *nunits,
375 int *pos_idx, int *unit_idx);
379 /***en @name Variables: Default Endian of UTF-16 and UTF-32 */
380 /***ja @name ÊÑ¿ô: UTF-16 ¤È UTF-32 ¤Î¥Ç¥Õ¥©¥ë¥È¤Î¥¨¥ó¥Ç¥£¥¢¥ó */
384 /*** @ingroup m17nMtext */
386 @brief Variable of value MTEXT_FORMAT_UTF_16LE or MTEXT_FORMAT_UTF_16BE.
388 The global variable #MTEXT_FORMAT_UTF_16 is initialized to
389 #MTEXT_FORMAT_UTF_16LE on a "Little Endian" system (storing words
390 with the least significant byte first), and to
391 #MTEXT_FORMAT_UTF_16BE on a "Big Endian" system (storing words
392 with the most significant byte first). */
395 @brief Ãͤ¬ MTEXT_FORMAT_UTF_16LE ¤« MTEXT_FORMAT_UTF_16BE ¤Ç¤¢¤ëÊÑ¿ô
397 Âç°èÊÑ¿ô #MTEXT_FORMAT_UTF_16 ¤Ï¥ê¥È¥ë¡¦¥¨¥ó¥Ç¥£¥¢¥ó¡¦¥·¥¹¥Æ¥à
398 ¡Ê¥ï¡¼¥É¤ò LSB (Least Significant Byte) ¤òÀè¤Ë¤·¤Æ³ÊǼ¡Ë¾å¤Ç¤Ï
399 #MTEXT_FORMAT_UTF_16LE ¤Ë½é´ü²½¤µ¤ì¡¢¥Ó¥Ã¥°¡¦¥¨¥ó¥Ç¥£¥¢¥ó¡¦¥·¥¹¥Æ¥à
400 ¡Ê¥ï¡¼¥É¤ò MSB (Most Significant Byte) ¤òÀè¤Ë¤·¤Æ³ÊǼ¡Ë¾å¤Ç¤Ï
401 #MTEXT_FORMAT_UTF_16BE ¤Ë½é´ü²½¤µ¤ì¤ë¡£ */
405 mtext_from_data () */
407 extern const enum MTextFormat MTEXT_FORMAT_UTF_16;
410 /*** @ingroup m17nMtext */
412 @brief Variable of value MTEXT_FORMAT_UTF_32LE or MTEXT_FORMAT_UTF_32BE.
414 The global variable #MTEXT_FORMAT_UTF_32 is initialized to
415 #MTEXT_FORMAT_UTF_32LE on a "Little Endian" system (storing words
416 with the least significant byte first), and to
417 #MTEXT_FORMAT_UTF_32BE on a "Big Endian" system (storing
418 words with the most significant byte first). */
421 @brief Ãͤ¬ MTEXT_FORMAT_UTF_32LE ¤« MTEXT_FORMAT_UTF_32BE ¤Ç¤¢¤ëÊÑ¿ô
423 Âç°èÊÑ¿ô #MTEXT_FORMAT_UTF_32 ¤Ï¥ê¥È¥ë¡¦¥¨¥ó¥Ç¥£¥¢¥ó¡¦¥·¥¹¥Æ¥à
424 ¡Ê¥ï¡¼¥É¤ò LSB (Least Significant Byte) ¤òÀè¤Ë¤·¤Æ³ÊǼ¡Ë¾å¤Ç¤Ï
425 #MTEXT_FORMAT_UTF_32LE ¤Ë½é´ü²½¤µ¤ì¡¢¥Ó¥Ã¥°¡¦¥¨¥ó¥Ç¥£¥¢¥ó¡¦¥·¥¹¥Æ¥à
426 ¡Ê¥ï¡¼¥É¤ò MSB (Most Significant Byte) ¤òÀè¤Ë¤·¤Æ³ÊǼ¡Ë¾å¤Ç¤Ï
427 #MTEXT_FORMAT_UTF_32BE ¤Ë½é´ü²½¤µ¤ì¤ë¡£ */
431 mtext_from_data () */
433 extern const int MTEXT_FORMAT_UTF_32;
439 extern MText *mtext_from_data (const void *data, int nitems,
440 enum MTextFormat format);
446 * (5-2) Functions to manipulate M-texts. They correspond to string
447 * manipulating functions in libc.
448 * In the following functions, mtext_XXX() corresponds to strXXX().
451 extern int mtext_len (MText *mt);
453 extern int mtext_ref_char (MText *mt, int pos);
455 extern int mtext_set_char (MText *mt, int pos, int c);
457 extern MText *mtext_copy (MText *mt1, int pos, MText *mt2, int from, int to);
459 extern int mtext_compare (MText *mt1, int from1, int to1,
460 MText *mt2, int from2, int to2);
462 extern int mtext_case_compare (MText *mt1, int from1, int to1,
463 MText *mt2, int from2, int to2);
465 extern int mtext_character (MText *mt, int from, int to, int c);
467 extern int mtext_del (MText *mt, int from, int to);
469 extern int mtext_ins (MText *mt1, int pos, MText *mt2);
471 extern int mtext_insert (MText *mt1, int pos, MText *mt2, int from, int to);
473 extern int mtext_ins_char (MText *mt, int pos, int c, int n);
475 extern int mtext_replace (MText *mt1, int from1, int to1,
476 MText *mt2, int from2, int to2);
478 extern MText *mtext_cat_char (MText *mt, int c);
480 extern MText *mtext_duplicate (MText *mt, int from, int to);
482 extern MText *mtext_dup (MText *mt);
484 extern MText *mtext_cat (MText *mt1, MText *mt2);
486 extern MText *mtext_ncat (MText *mt1, MText *mt2, int n);
488 extern MText *mtext_cpy (MText *mt1, MText *mt2);
490 extern MText *mtext_ncpy (MText *mt1, MText *mt2, int n);
492 extern int mtext_chr (MText *mt, int c);
494 extern int mtext_rchr (MText *mt, int c);
496 extern int mtext_cmp (MText *mt1, MText *mt2);
498 extern int mtext_ncmp (MText *mt1, MText *mt2, int n);
500 extern int mtext_spn (MText *mt1, MText *mt2);
502 extern int mtext_cspn (MText *mt1, MText *mt2);
504 extern int mtext_pbrk (MText *mt1, MText *mt2);
506 extern int mtext_text (MText *mt1, int pos, MText *mt2);
508 extern int mtext_search (MText *mt1, int from, int to, MText *mt2);
510 extern MText *mtext_tok (MText *mt, MText *delim, int *pos);
512 extern int mtext_casecmp (MText *mt1, MText *mt2);
514 extern int mtext_ncasecmp (MText *mt1, MText *mt2, int n);
517 @brief Enumeration for specifying a set of line breaking option.
519 The enum #MTextLineBreakOption is to control the line breaking
520 algorithm of the function mtext_line_break () by specifying
521 logical-or of the members in the arg @e option. */
523 enum MTextLineBreakOption
525 /***en Specify the legacy support for space character as base for
526 combining marks. See the section 8.3 of UAX#14. */
528 /***en Specify to use space characters for line breaking Korean
530 MTEXT_LBO_KOREAN_SP = 2,
531 /***en Specify to treat characters of ambiguous line-breaking
532 class as of ideographic line-breaking class. */
533 MTEXT_LBO_AI_AS_ID = 4,
537 extern int mtext_line_break (MText *mt, int pos, int option, int *after);
539 /*** @ingroup m17nPlist */
540 extern MPlist *mplist_deserialize (MText *mt);
543 * (5-3) Text properties
546 /*** @ingroup m17nCore */
547 /***en @defgroup m17nTextProperty Text Property */
548 /***ja @defgroup m17nTextProperty ¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£ */
550 /*** @ingroup m17nTextProperty */
552 @brief Flag bits to control text property.
554 The mtext_property () funciton accepts logical OR of these flag
555 bits as an argument. They control the behaviour of the created
556 text property as described in the documentation of each flag
560 @brief ¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤òÀ©¸æ¤¹¤ë¥Õ¥é¥°¥Ó¥Ã¥È.
562 ´Ø¿ô mtext_property () ¤Ï°Ê²¼¤Î¥Õ¥é¥°¥Ó¥Ã¥È¤ÎÏÀÍý
563 OR ¤ò°ú¿ô¤È¤·¤Æ¤È¤ë¤³¤È¤¬¤Ç¤¤ë¡£
564 ¥Õ¥é¥°¥Ó¥Ã¥È¤ÏÀ¸À®¤µ¤ì¤¿¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤Î¿¶Éñ¤¤¤òÀ©¸æ¤¹¤ë¡£
565 ¾ÜºÙ¤Ï³Æ¥Õ¥é¥°¥Ó¥Ã¥È¤ÎÀâÌÀ¤ò»²¾È¡£*/
567 enum MTextPropertyControl
569 /***en If this flag bit is on, an M-text inserted at the start
570 position or at the middle of the text property inherits the
572 /***ja ¤³¤Î¥Ó¥Ã¥È¤¬ on ¤Ê¤é¤Ð¡¢¤³¤Î¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤Î»Ï¤Þ¤ëÅÀ¤¢¤ë¤¤¤ÏÃæ´Ö¤ËÁÞÆþ¤µ¤ì¤¿
573 M-text ¤Ï¤³¤Î¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤ò·Ñ¾µ¤¹¤ë¡£
575 MTEXTPROP_FRONT_STICKY = 0x01,
577 /***en If this flag bit is on, an M-text inserted at the end
578 position or at the middle of the text property inherits the
580 /***ja ¤³¤Î¥Ó¥Ã¥È¤¬ on ¤Ê¤é¤Ð¡¢¤³¤Î¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤Î½ª¤ï¤ëÅÀ¤¢¤ë¤¤¤ÏÃæ´Ö¤ËÁÞÆþ¤µ¤ì¤¿
581 M-text ¤Ï¤³¤Î¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤ò·Ñ¾µ¤¹¤ë¡£
583 MTEXTPROP_REAR_STICKY = 0x02,
585 /***en If this flag bit is on, the text property is removed if a
586 text in its region is modified. */
587 /***ja ¤³¤Î¥Ó¥Ã¥È¤¬ on ¤Ê¤é¤Ð¡¢¤³¤Î¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤ÎÈÏ°ÏÆâ¤Î¥Æ¥¥¹¥È¤¬Êѹ¹¤µ¤ì¤¿¾ì¹ç¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤Ï¼è¤ê½ü¤«¤ì¤ë¡£ */
588 MTEXTPROP_VOLATILE_WEAK = 0x04,
590 /***en If this flag bit is on, the text property is removed if a
591 text or the other text property in its region is modified. */
592 /***ja ¤³¤Î¥Ó¥Ã¥È¤¬ on ¤Ê¤é¤Ð¡¢¤³¤Î¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤ÎÈÏ°ÏÆâ¤Î¥Æ¥¥¹¥È¤¢¤ë¤¤¤ÏÊ̤Υƥ¥¹¥È¥×¥í¥Ñ¥Æ¥£¤¬Êѹ¹¤µ¤ì¤¿¾ì¹ç¤³¤Î¥Æ¥
593 ¥¹¥È¥×¥í¥Ñ¥Æ¥£¤Ï¼è¤ê½ü¤«¤ì¤ë¡£*/
594 MTEXTPROP_VOLATILE_STRONG = 0x08,
596 /***en If this flag bit is on, the text property is not
597 automatically merged with the others. */
598 /***ja ¤³¤Î¥Ó¥Ã¥È¤¬ on ¤Ê¤é¤Ð¡¢¤³¤Î¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤Ï¾¤Î¥×¥í¥Ñ¥Æ¥£¤È¼«Æ°Åª¤Ë¤Ï¥Þ¡¼¥¸¤µ¤ì¤Ê¤¤¡£ */
599 MTEXTPROP_NO_MERGE = 0x10,
601 MTEXTPROP_CONTROL_MAX = 0x1F
605 extern MSymbol Mtext_prop_serializer;
606 extern MSymbol Mtext_prop_deserializer;
609 /*** @ingroup m17nTextProperty */
611 @brief Type of serializer functions.
613 This is the type of serializer functions. If the key of a symbol
614 property is #Mtext_prop_serializer, the value must be of this
618 mtext_serialize (), #Mtext_prop_serializer
621 @brief ¥·¥ê¥¢¥é¥¤¥¶´Ø¿ô¤Î·¿Àë¸À.
623 ¥·¥ê¥¢¥é¥¤¥¶´Ø¿ô¤Î·¿¤Ç¤¢¤ë¡£ ¤¢¤ë¥·¥ó¥Ü¥ë¤Î¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤¬ @c
624 #Mtext_prop_serializer ¤Ç¤¢¤ë¤È¤¡¢ ÃͤϤ³¤Î·¿¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
627 mtext_serialize (), #Mtext_prop_serializer
630 typedef MPlist *(*MTextPropSerializeFunc) (void *val);
632 /*** @ingroup m17nTextProperty */
634 @brief Type of deserializer functions.
636 This is the type of deserializer functions. If the key of a
637 symbol property is #Mtext_prop_deserializer, the value must be of
641 mtext_deserialize (), #Mtext_prop_deserializer
644 @brief ¥Ç¥·¥ê¥¢¥é¥¤¥¶´Ø¿ô¤Î·¿Àë¸À.
646 ¥Ç¥·¥ê¥¢¥é¥¤¥¶´Ø¿ô¤Î·¿¤Ç¤¢¤ë¡£ ¤¢¤ë¥·¥ó¥Ü¥ë¤Î¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤¬ @c
647 #Msymbol_prop_deserializer ¤Ç¤¢¤ë¤È¤¡¢ ÃͤϤ³¤Î·¿¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
650 Mtext_prop_deserialize (), Mtext_prop_deserializer
652 typedef void *(*MTextPropDeserializeFunc) (MPlist *plist);
654 extern void *mtext_get_prop (MText *mt, int pos, MSymbol key);
656 extern int mtext_get_prop_values (MText *mt, int pos, MSymbol key,
657 void **values, int num);
659 extern int mtext_get_prop_keys (MText *mt, int pos, MSymbol **keys);
661 extern int mtext_put_prop (MText *mt, int from, int to,
662 MSymbol key, void *val);
664 extern int mtext_put_prop_values (MText *mt, int from, int to,
665 MSymbol key, void **values, int num);
667 extern int mtext_push_prop (MText *mt, int from, int to,
668 MSymbol key, void *val);
670 extern int mtext_pop_prop (MText *mt, int from, int to,
673 extern int mtext_prop_range (MText *mt, MSymbol key, int pos,
674 int *from, int *to, int deeper);
678 @ingroup m17nTextProperty */
680 @brief Type of text properties.
682 The type #MTextProperty is for a @e text @e property objects. Its
683 internal structure is concealed from application programs. */
685 @brief @c ¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤Î·¿Àë¸À.
687 #MTextProperty ¤Ï @e ¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£ ¥ª¥Ö¥¸¥§¥¯¥È¤Î·¿¤Ç¤¢¤ë¡£
688 ÆâÉô¹½Â¤¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤«¤é¤Ï¸«¤¨¤Ê¤¤¡£ */
690 typedef struct MTextProperty MTextProperty;
694 extern MTextProperty *mtext_property (MSymbol key, void *val,
697 extern MText *mtext_property_mtext (MTextProperty *prop);
699 extern MSymbol mtext_property_key (MTextProperty *prop);
701 extern void *mtext_property_value (MTextProperty *prop);
703 extern int mtext_property_start (MTextProperty *prop);
705 extern int mtext_property_end (MTextProperty *prop);
707 extern MTextProperty *mtext_get_property (MText *mt, int pos, MSymbol key);
709 extern int mtext_get_properties (MText *mt, int pos, MSymbol key,
710 MTextProperty **props, int num);
712 extern int mtext_attach_property (MText *mt, int from, int to,
713 MTextProperty *prop);
715 extern int mtext_detach_property (MTextProperty *prop);
717 extern int mtext_push_property (MText *mt, int from, int to,
718 MTextProperty *prop);
720 extern MText *mtext_serialize (MText *mt, int from, int to,
721 MPlist *property_list);
723 extern MText *mtext_deserialize (MText *mt);
729 #endif /* _M17N_CORE_H_ */