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