(core_initialized): Delete this variable.
[m17n/m17n-lib.git] / src / m17n-core.h
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
5
6    This file is part of the m17n library.
7
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.
12
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.
17
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
21    02111-1307, USA.  */
22
23 #ifndef _M17N_CORE_H_
24 #define _M17N_CORE_H_
25
26 #ifdef __cplusplus
27 extern "C"
28 {
29 #endif
30
31 /*
32  * Header file for m17n library.
33  */
34
35 /* (C1) Introduction */
36
37 /***en @defgroup m17nIntro Introduction  */
38 /***ja @defgroup m17nIntro ¤Ï¤¸¤á¤Ë  */
39 /*=*/
40
41 #define M17NLIB_MAJOR_VERSION 1
42 #define M17NLIB_MINOR_VERSION 1
43 #define M17NLIB_PATCH_LEVEL 0
44 #define M17NLIB_VERSION_NAME "1.1.0"
45
46 extern void m17n_init_core (void);
47 #define M17N_INIT() m17n_init_core ()
48 extern void m17n_fini_core (void);
49 #define M17N_FINI() m17n_fini_core ()
50
51 /*=*/
52
53 /*** @addtogroup m17nIntro */
54 /*** @{ */
55
56 /***en
57     @brief Enumeration for the status of the m17n librarry.
58
59     The enum #MTextFormat is used as a return value of the function
60     m17n_status ().  */
61
62 enum M17NStatus
63   {
64     /***en No modules is initialized, and all modules are finalized.  */
65     M17N_NOT_INITIALIZED, 
66     /***en Only the modules in CORE API are initialized.  */
67     M17N_CORE_INITIALIZED,
68     /***en Only the modules in CORE and SHELL APIs are initialized.  */
69     M17N_SHELL_INITIALIZED, 
70     /***en All modules are initialized.  */
71     M17N_GUI_INITIALIZED
72   };
73
74 /*** @} */
75 /*=*/
76
77 extern enum M17NStatus m17n_status (void);
78
79 /***en @defgroup m17nCore CORE API  */
80 /***ja @defgroup m17nCore ¥³¥¢ API */
81 /*=*/
82 /*** @ingroup m17nCore */
83 /***en @defgroup m17nObject Managed Object */
84 /***ja @defgroup m17nObject ´ÉÍý²¼¥ª¥Ö¥¸¥§¥¯¥È */
85 /*=*/
86
87 /*** @ingroup m17nObject  */
88 /***en
89     @brief The first member of a managed object.
90
91     When an application program defines a new structure for managed
92     objects, its first member must be of the type @c struct
93     #M17NObjectHead.  Its contents are used by the m17n library, and
94     application programs should never touch them.  */
95 /***ja
96     @brief ´ÉÍý²¼¥ª¥Ö¥¸¥§¥¯¥È¤ÎºÇ½é¤Î¥á¥ó¥Ð.
97
98     ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤¬¿·¤·¤¤¹½Â¤ÂΤò´ÉÍý²¼¥ª¥Ö¥¸¥§¥¯¥È¤È¤·¤Æ
99      ÄêµÁ¤¹¤ëºÝ¤Ë¤Ï¡¢ºÇ½é¤Î¥á¥ó¥Ð¤Ï @c #M17NObjectHead ¹½Â¤Âη¿¤Ç¤Ê¤¯
100      ¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£@c #M17NObjectHead ¤ÎÆâÍƤϠm17n ¥é¥¤¥Ö¥é¥ê¤¬»ÈÍѤ¹
101      ¤ë¤Î¤Ç¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤Ï¿¨¤ì¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
102      */
103
104 typedef struct
105 {
106   void *filler[2];
107 } M17NObjectHead;
108
109 /*=*/
110
111 /* Return a newly allocated managed object.  */
112 extern void *m17n_object_setup (int size, void (*freer) (void *));
113
114 /* Increment the reference count of managed object OBJECT.  */
115 extern int m17n_object_ref (void *object);
116
117 /* Decrement the reference count of managed object OBJECT.  */
118 extern int m17n_object_unref (void *object);
119
120 /*=*/
121
122 /* (C2) Symbol handling */
123
124 /*** @ingroup m17nCore */
125 /***en @defgroup m17nSymbol Symbol  */
126 /***ja @defgroup m17nSymbol ¥·¥ó¥Ü¥ë */
127 /*=*/
128
129 /***
130     @ingroup m17nSymbol */
131 /***en
132     @brief Type of symbols.
133
134     The type #MSymbol is for a @e symbol object.  Its internal
135     structure is concealed from application programs.  */
136
137 /***ja
138     @brief ¥·¥ó¥Ü¥ë¤Î·¿Àë¸À.
139
140     #MSymbol ¤Ï¥·¥ó¥Ü¥ë¥ª¥Ö¥¸¥§¥¯¥È¤Î·¿¤Ç¤¢¤ë¡£ÆâÉô¹½Â¤¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç
141     ¥ó¥×¥í¥°¥é¥à¤«¤é¤Ï¸«¤¨¤Ê¤¤¡£  */
142
143 typedef struct MSymbolStruct *MSymbol;
144
145 /*=*/
146
147 /* Predefined symbols. */ 
148 extern MSymbol Mnil;
149 extern MSymbol Mt;
150 extern MSymbol Mstring;
151 extern MSymbol Msymbol;
152 extern MSymbol Mtext;
153
154 /* Return a symbol of name NAME.  */
155 extern MSymbol msymbol (const char *name);
156
157 /* Return a managing key of name NAME.  */
158 extern MSymbol msymbol_as_managing_key (const char *name);
159
160 /* Return a symbol of name NAME if it already exists.  */
161 extern MSymbol msymbol_exist (const char *name);
162
163 /* Return the name of SYMBOL.  */
164 extern char *msymbol_name (MSymbol symbol);
165
166 /* Give SYMBOL KEY property with value VALUE.  */
167 extern int msymbol_put (MSymbol symbol, MSymbol key, void *val);
168
169 /*** Return KEY property value of SYMBOL.  */
170 extern void *msymbol_get (MSymbol symbol, MSymbol key);
171
172 /* 
173  *  (2-1) Property List
174  */
175 /*=*/
176 /*** @ingroup m17nCore */
177 /***en @defgroup m17nPlist Property List */
178 /***ja @defgroup m17nPlist ¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È */
179 /*=*/
180
181 /***
182     @ingroup m17nPlist */ 
183 /***en
184     @brief Type of property list objects.
185
186     The type #MPlist is for a @e property @e list object.  Its internal
187     structure is concealed from application programs.  */
188
189 /***ja
190     @brief ¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È¡¦¥ª¥Ö¥¸¥§¥¯¥È¤Î·¿Àë¸À.
191
192     #MPlist ¤Ï @e ¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È (Property list) ¥ª¥Ö¥¸¥§¥¯¥È¤Î·¿¤Ç¤¢¤ë¡£
193     ÆâÉô¹½Â¤¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤«¤é¤Ï¸«¤¨¤Ê¤¤¡£  */
194
195 typedef struct MPlist MPlist;
196
197 /*=*/
198
199 extern MSymbol Mplist, Minteger;
200
201 extern MPlist *mplist ();
202
203 extern MPlist *mplist_copy (MPlist *plist);
204
205 extern MPlist *mplist_add (MPlist *plist, MSymbol key, void *val);
206
207 extern MPlist *mplist_push (MPlist *plist, MSymbol key, void *val);
208
209 extern void *mplist_pop (MPlist *plist);
210
211 extern MPlist *mplist_put (MPlist *plist, MSymbol key, void *val);
212
213 extern void *mplist_get (MPlist *plist, MSymbol key);
214
215 extern MPlist *mplist_find_by_key (MPlist *plist, MSymbol key);
216
217 extern MPlist *mplist_find_by_value (MPlist *plist, void *val);
218
219 extern MPlist *mplist_next (MPlist *plist);
220
221 extern MPlist *mplist_set (MPlist *plist, MSymbol key, void *val);
222
223 extern int mplist_length (MPlist *plist);
224
225 extern MSymbol mplist_key (MPlist *plist);
226
227 extern void *mplist_value (MPlist *plist);
228
229 /* (S1) Characters */
230
231 /*=*/
232 /*** @ingroup m17nCore */
233 /***en @defgroup m17nCharacter Character */
234 /***ja @defgroup m17nCharacter Ê¸»ú */
235 /*=*/
236
237 #define MCHAR_MAX 0x3FFFFF
238 /*#define MCHAR_MAX 0x7FFFFFFF*/
239
240 extern MSymbol Mscript;
241 extern MSymbol Mname;
242 extern MSymbol Mcategory;
243 extern MSymbol Mcombining_class;
244 extern MSymbol Mbidi_category;
245 extern MSymbol Msimple_case_folding;
246 extern MSymbol Mcomplicated_case_folding;
247
248 extern MSymbol mchar_define_property (const char *name, MSymbol type);
249
250 extern void *mchar_get_prop (int c, MSymbol key);
251
252 extern int mchar_put_prop (int c, MSymbol key, void *val);
253
254 /* (C3) Handling chartable */
255
256 /*** @ingroup m17nCore */
257 /***en @defgroup m17nChartable Chartable */
258 /***ja @defgroup m17nChartable Ê¸»ú¥Æ¡¼¥Ö¥ë */
259 /*=*/
260 extern MSymbol Mchar_table;
261
262 /***
263     @ingroup m17nChartable */
264 /***en
265     @brief Type of chartables.
266
267     The type #MCharTable is for a @e chartable objects.  Its
268     internal structure is concealed from application programs.  */
269
270 /***ja
271     @brief Ê¸»ú¥Æ¡¼¥Ö¥ë¤Î·¿Àë¸À.
272
273     #MCharTable ¤Ï @e Ê¸»ú¥Æ¡¼¥Ö¥ë (chartable) ¥ª¥Ö¥¸¥§¥¯¥È¤Î·¿¤Ç¤¢¤ë¡£
274     ÆâÉô¹½Â¤¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤«¤é¤Ï¸«¤¨¤Ê¤¤¡£  */
275
276 typedef struct MCharTable MCharTable;
277 /*=*/
278
279 extern MCharTable *mchartable (MSymbol key, void *default_value);
280
281 extern void *mchartable_lookup (MCharTable *table, int c);
282
283 extern int mchartable_set (MCharTable *table, int c, void *val);
284
285 extern int mchartable_set_range (MCharTable *table, int from, int to,
286                                  void *val);
287
288 extern int mchartable_map (MCharTable *table, void *ignore,
289                            void (*func) (int from, int to,
290                                          void *val, void *arg), 
291                            void *func_arg);
292
293 extern void mchartable_range (MCharTable *table, int *from, int *to);
294
295 /*
296  *  (5) Handling M-text.
297  *      "M" of M-text stands for:
298  *      o Multilingual
299  *      o Metamorphic
300  *      o More than string
301  */
302
303 /*** @ingroup m17nCore */
304 /***en @defgroup m17nMtext M-text */
305 /***ja @defgroup m17nMtext M-text */
306 /*=*/
307
308 /*
309  * (5-1) M-text basics
310  */
311 /*=*/
312 /*** @ingroup m17nMtext */
313 /***en
314     @brief Type of @e M-texts.
315
316     The type #MText is for an @e M-text object.  Its internal
317     structure is concealed from application programs.  */
318
319 /***ja
320     @brief @e MText ¤Î·¿Àë¸À.
321
322     #Mtext ¤Ï @e M-text ¥ª¥Ö¥¸¥§¥¯¥È¤Î·¿¤Ç¤¢¤ë¡£
323     ÆâÉô¹½Â¤¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤«¤é¤Ï¸«¤¨¤Ê¤¤¡£ 
324
325     @latexonly \IPAlabel{MText} @endlatexonly
326     @latexonly \IPAlabel{MText->MPlist} @endlatexonly  */
327
328 typedef struct MText MText;
329
330 /*=*/
331
332 extern MText *mtext ();
333
334 /*=*/
335
336 /***en
337     @brief Enumeration for specifying the format of an M-text.
338
339     The enum #MTextFormat is used as an argument of the
340     mtext_from_data () function to specify the format of data from
341     which an M-text is created.  */
342
343 /***ja
344     @brief M-text ¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤ò»ØÄꤹ¤ëÎóµó·¿.
345
346     Îóµó·¿ #MTextFormat ¤Ï
347     ´Ø¿ô mtext_from_data () ¤Î°ú¿ô¤È¤·¤ÆÍѤ¤¤é¤ì¡¢
348     M-text ¤òÀ¸À®¤¹¤ë¸µ¤È¤Ê¤ë¥Ç¡¼¥¿¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤ò»ØÄꤹ¤ë¡£  */
349
350 enum MTextFormat
351   {
352     MTEXT_FORMAT_US_ASCII,
353     MTEXT_FORMAT_UTF_8,
354     MTEXT_FORMAT_UTF_16LE,
355     MTEXT_FORMAT_UTF_16BE,
356     MTEXT_FORMAT_UTF_32LE,
357     MTEXT_FORMAT_UTF_32BE,
358     MTEXT_FORMAT_MAX
359   };
360 /*=*/
361
362 extern const enum MTextFormat MTEXT_FORMAT_UTF_16;
363 extern const enum MTextFormat MTEXT_FORMAT_UTF_32;
364
365 /*=*/
366
367 extern MText *mtext_from_data (const void *data, int nitems,
368                                enum MTextFormat format);
369
370
371 /*=*/
372
373 /*
374  *  (5-2) Functions to manipulate M-texts.  They correspond to string
375  *   manipulating functions in libc.
376  *   In the following functions, mtext_XXX() corresponds to strXXX().
377  */
378
379 extern int mtext_len (MText *mt);
380
381 extern int mtext_ref_char (MText *mt, int pos);
382
383 extern int mtext_set_char (MText *mt, int pos, int c);
384
385 extern MText *mtext_copy (MText *mt1, int pos, MText *mt2, int from, int to);
386
387 extern int mtext_compare (MText *mt1, int from1, int to1,
388                           MText *mt2, int from2, int to2);
389
390 extern int mtext_case_compare (MText *mt1, int from1, int to1,
391                                MText *mt2, int from2, int to2);
392
393 extern int mtext_character (MText *mt, int from, int to, int c);
394
395 extern int mtext_del (MText *mt, int from, int to);
396
397 extern int mtext_ins (MText *mt1, int pos, MText *mt2);
398
399 extern int mtext_ins_char (MText *mt, int pos, int c, int n);
400
401 extern MText *mtext_cat_char (MText *mt, int c);
402
403 extern MText *mtext_duplicate (MText *mt, int from, int to);
404
405 extern MText *mtext_dup (MText *mt);
406
407 extern MText *mtext_cat (MText *mt1, MText *mt2);
408
409 extern MText *mtext_ncat (MText *mt1, MText *mt2, int n);
410
411 extern MText *mtext_cpy (MText *mt1, MText *mt2);
412
413 extern MText *mtext_ncpy (MText *mt1, MText *mt2, int n);
414
415 extern int mtext_chr (MText *mt, int c);
416
417 extern int mtext_rchr (MText *mt, int c);
418
419 extern int mtext_cmp (MText *mt1, MText *mt2);
420
421 extern int mtext_ncmp (MText *mt1, MText *mt2, int n);
422
423 extern int mtext_spn (MText *mt1, MText *mt2);
424
425 extern int mtext_cspn (MText *mt1, MText *mt2);
426
427 extern int mtext_pbrk (MText *mt1, MText *mt2);
428
429 extern int mtext_text (MText *mt1, int pos, MText *mt2);
430
431 extern int mtext_search (MText *mt1, int from, int to, MText *mt2);
432
433 extern MText *mtext_tok (MText *mt, MText *delim, int *pos);
434
435 extern int mtext_casecmp (MText *mt1, MText *mt2);
436
437 extern int mtext_ncasecmp (MText *mt1, MText *mt2, int n);
438
439 /*** @ingroup m17nPlist */
440 extern MPlist *mplist_deserialize (MText *mt);
441
442 /*
443  * (5-3) Text properties
444  */
445 /*=*/
446 /*** @ingroup m17nCore */
447 /***en @defgroup m17nTextProperty Text Property */
448 /***ja @defgroup m17nTextProperty ¥Æ¥­¥¹¥È¥×¥í¥Ñ¥Æ¥£ */
449 /*=*/
450 /*** @ingroup m17nTextProperty */
451 /***en
452     @brief Flag bits to control text property.
453
454     The mtext_property () funciton accepts logical OR of these flag
455     bits as an argument.  They control the behaviour of the created
456     text property as described in the documentation of each flag
457     bit.  */
458
459 /***ja
460     @brief ¥Æ¥­¥¹¥È¥×¥í¥Ñ¥Æ¥£¤òÀ©¸æ¤¹¤ë¥Õ¥é¥°¥Ó¥Ã¥È.
461
462     ´Ø¿ô mtext_property () ¤Ï°Ê²¼¤Î¥Õ¥é¥°¥Ó¥Ã¥È¤ÎÏÀÍý OR ¤ò°ú¿ô¤È¤·¤Æ
463     ¤È¤ë¤³¤È¤¬¤Ç¤­¤ë¡£¥Õ¥é¥°¥Ó¥Ã¥È¤ÏÀ¸À®¤µ¤ì¤¿¥Æ¥­¥¹¥È¥×¥í¥Ñ¥Æ¥£¤Î¿¶Éñ
464     ¤¤¤òÀ©¸æ¤¹¤ë¡£¾ÜºÙ¤Ï³Æ¥Õ¥é¥°¥Ó¥Ã¥È¤ÎÀâÌÀ¤ò»²¾È¡£*/
465
466 enum MTextPropertyControl
467   {
468     /***en If this flag bit is on, an M-text inserted at the start
469         position or at the middle of the text property inherits the
470         text property.  */
471     /***ja ¤³¤Î¥Ó¥Ã¥È¤¬ on ¤Ê¤é¤Ð¡¢¤³¤Î¥Æ¥­¥¹¥È¥×¥í¥Ñ¥Æ¥£¤Î»Ï¤Þ¤ëÅÀ¤¢
472         ¤ë¤¤¤ÏÃæ´Ö¤ËÁÞÆþ¤µ¤ì¤¿ M-text ¤Ï¤³¤Î¥Æ¥­¥¹¥È¥×¥í¥Ñ¥Æ¥£¤ò·Ñ¾µ¤¹¤ë¡£
473         */
474     MTEXTPROP_FRONT_STICKY = 0x01,
475
476     /***en If this flag bit is on, an M-text inserted at the end
477         position or at the middle of the text property inherits the
478         text property.  */
479     /***ja ¤³¤Î¥Ó¥Ã¥È¤¬ on ¤Ê¤é¤Ð¡¢¤³¤Î¥Æ¥­¥¹¥È¥×¥í¥Ñ¥Æ¥£¤Î½ª¤ï¤ëÅÀ¤¢
480         ¤ë¤¤¤ÏÃæ´Ö¤ËÁÞÆþ¤µ¤ì¤¿ M-text ¤Ï¤³¤Î¥Æ¥­¥¹¥È¥×¥í¥Ñ¥Æ¥£¤ò·Ñ¾µ¤¹¤ë¡£
481         */
482     MTEXTPROP_REAR_STICKY = 0x02,
483
484     /***en If this flag bit is on, the text property is removed if a
485         text in its region is modified.  */
486     /***ja ¤³¤Î¥Ó¥Ã¥È¤¬ on ¤Ê¤é¤Ð¡¢¤³¤Î¥Æ¥­¥¹¥È¥×¥í¥Ñ¥Æ¥£¤ÎÈÏ°ÏÆâ¤Î
487         ¥Æ¥­¥¹¥È¤¬Êѹ¹¤µ¤ì¤¿¾ì¹ç¥Æ¥­¥¹¥È¥×¥í¥Ñ¥Æ¥£¤Ï¼è¤ê½ü¤«¤ì¤ë¡£  */
488     MTEXTPROP_VOLATILE_WEAK = 0x04,
489
490     /***en If this flag bit is on, the text property is removed if a
491         text or the other text property in its region is modified.  */
492     /***ja ¤³¤Î¥Ó¥Ã¥È¤¬ on ¤Ê¤é¤Ð¡¢¤³¤Î¥Æ¥­¥¹¥È¥×¥í¥Ñ¥Æ¥£¤ÎÈÏ°ÏÆâ¤Î
493         ¥Æ¥­¥¹¥È¤¢¤ë¤¤¤ÏÊ̤Υƥ­¥¹¥È¥×¥í¥Ñ¥Æ¥£¤¬Êѹ¹¤µ¤ì¤¿¾ì¹ç¤³¤Î¥Æ¥­
494         ¥¹¥È¥×¥í¥Ñ¥Æ¥£¤Ï¼è¤ê½ü¤«¤ì¤ë¡£*/
495     MTEXTPROP_VOLATILE_STRONG = 0x08,
496
497     /***en If this flag bit is on, the text property is not
498         automatically merged with the others.  */
499     /***ja ¤³¤Î¥Ó¥Ã¥È¤¬ on ¤Ê¤é¤Ð¡¢¤³¤Î¥Æ¥­¥¹¥È¥×¥í¥Ñ¥Æ¥£¤Ï¾¤Î¥×¥í¥Ñ
500         ¥Æ¥£¤È¼«Æ°Åª¤Ë¤Ï¥Þ¡¼¥¸¤µ¤ì¤Ê¤¤¡£ */
501     MTEXTPROP_NO_MERGE = 0x10,
502
503     MTEXTPROP_CONTROL_MAX = 0x1F
504   };
505
506 /*=*/
507 extern MSymbol Mtext_prop_serializer;
508 extern MSymbol Mtext_prop_deserializer;
509
510
511 /*** @ingroup m17nTextProperty */
512 /***en
513     @brief Type of serializer functions.
514
515     This is the type of serializer functions.  If the key of a symbol
516     property is #Msymbol_prop_serializer, the value must be of this
517     type.
518
519     @seealso Mtext_prop_serialize (), Mtext_prop_serializer
520 */
521 /***ja
522     @brief ¥·¥ê¥¢¥é¥¤¥¶´Ø¿ô¤Î·¿Àë¸À.
523
524     ¥·¥ê¥¢¥é¥¤¥¶´Ø¿ô¤Î·¿¤Ç¤¢¤ë¡£ ¤¢¤ë¥·¥ó¥Ü¥ë¤Î¥×¥í¥Ñ¥Æ¥£¤Î¥­¡¼¤¬ @c
525     #Msymbol_prop_serializer ¤Ç¤¢¤ë¤È¤­¡¢ ÃͤϤ³¤Î·¿¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
526
527     @seealso Mtext_prop_serialize (), Mtext_prop_serializer
528 */
529
530 typedef MPlist *(*MTextPropSerializeFunc) (void *val);
531
532 /*** @ingroup m17nTextProperty */
533 /***en
534     @brief Type of deserializer functions.
535
536     This is the type of deserializer functions.  If the key of a
537     symbol property is #Msymbol_prop_deserializer, the value must be
538     of this type.
539
540     @seealso Mtext_prop_deserialize (), Mtext_prop_deserializer
541 */
542 /***ja
543     @brief ¥Ç¥·¥ê¥¢¥é¥¤¥¶´Ø¿ô¤Î·¿Àë¸À.
544
545     ¥Ç¥·¥ê¥¢¥é¥¤¥¶´Ø¿ô¤Î·¿¤Ç¤¢¤ë¡£ ¤¢¤ë¥·¥ó¥Ü¥ë¤Î¥×¥í¥Ñ¥Æ¥£¤Î¥­¡¼¤¬ @c
546     #Msymbol_prop_deserializer ¤Ç¤¢¤ë¤È¤­¡¢ ÃͤϤ³¤Î·¿¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
547
548     @seealso Mtext_prop_deserialize (), Mtext_prop_deserializer
549 */
550 typedef void *(*MTextPropDeserializeFunc) (MPlist *plist);
551
552 extern void *mtext_get_prop (MText *mt, int pos, MSymbol key);
553
554 extern int mtext_get_prop_values (MText *mt, int pos, MSymbol key,
555                                   void **values, int num);
556
557 extern int mtext_get_prop_keys (MText *mt, int pos, MSymbol **keys);
558
559 extern int mtext_put_prop (MText *mt, int from, int to,
560                            MSymbol key, void *val);
561
562 extern int mtext_put_prop_values (MText *mt, int from, int to,
563                                   MSymbol key, void **values, int num);
564
565 extern int mtext_push_prop (MText *mt, int from, int to,
566                             MSymbol key, void *val);
567
568 extern int mtext_pop_prop (MText *mt, int from, int to,
569                            MSymbol key);
570
571 extern int mtext_change_prop (MText *mt, int from, int to,
572                               MSymbol key,
573                               int (*func) (int, void ***, int *));
574
575 extern int mtext_prop_range (MText *mt, MSymbol key, int pos,
576                              int *from, int *to, int deeper);
577
578 /*=*/
579 typedef struct MTextProperty MTextProperty;
580
581 /*=*/
582
583 extern MTextProperty *mtext_property (MSymbol key, void *val,
584                                       int control_bits);
585
586 extern MText *mtext_property_mtext (MTextProperty *prop);
587
588 extern MSymbol mtext_property_key (MTextProperty *prop);
589
590 extern void *mtext_property_value (MTextProperty *prop);
591
592 extern int mtext_property_start (MTextProperty *prop);
593
594 extern int mtext_property_end (MTextProperty *prop);
595
596 extern MTextProperty *mtext_get_property (MText *mt, int pos, MSymbol key);
597
598 extern int mtext_get_properties (MText *mt, int pos, MSymbol key,
599                                  MTextProperty **props, int num);
600
601 extern int mtext_attach_property (MText *mt, int from, int to,
602                                   MTextProperty *prop);
603
604 extern int mtext_detach_property (MTextProperty *prop);
605
606 extern int mtext_push_property (MText *mt, int from, int to,
607                                 MTextProperty *prop);
608
609 extern MText *mtext_serialize (MText *mt, int from, int to,
610                                MPlist *property_list);
611
612 extern MText *mtext_deserialize (MText *mt);
613
614 #ifdef __cplusplus
615 }
616 #endif
617
618 #endif /* _M17N_CORE_H_ */
619
620 /*
621   Local Variables:
622   coding: euc-japan
623   End:
624 */