/usr/include/m17n-core.h is in libm17n-dev 1.6.4-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 | /* m17n-core.h -- header file for the CORE API of the m17n library.
Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H15PRO112
This file is part of the m17n library.
The m17n library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License
as published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
The m17n library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the m17n library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
02111-1307, USA. */
#ifndef _M17N_CORE_H_
#define _M17N_CORE_H_
#ifdef __cplusplus
#define M17N_BEGIN_HEADER extern "C" {
#define M17N_END_HEADER }
#else
#define M17N_BEGIN_HEADER /* do nothing */
#define M17N_END_HEADER /* do nothing */
#endif
M17N_BEGIN_HEADER
/*
* Header file for m17n library.
*/
/* (C1) Introduction */
/***en @defgroup m17nIntro Introduction */
/***ja @defgroup m17nIntro ¤Ï¤¸¤á¤Ë */
/*=*/
#if !defined (FOR_DOXYGEN) || defined (DOXYGEN_INTERNAL_MODULE)
#define M17NLIB_MAJOR_VERSION 1
#define M17NLIB_MINOR_VERSION 6
#define M17NLIB_PATCH_LEVEL 4
#define M17NLIB_VERSION_NAME "1.6.4"
extern void m17n_init_core (void);
#define M17N_INIT() m17n_init_core ()
extern void m17n_fini_core (void);
#define M17N_FINI() m17n_fini_core ()
extern int merror_code;
#endif
/*=*/
/*** @ingroup m17nIntro */
/***en
@brief Enumeration for the status of the m17n library.
The enum #M17NStatus is used as a return value of the function
m17n_status (). */
/***ja
@brief m17n ¥é¥¤¥Ö¥é¥ê¤Î¾õÂÖ¤ò¼¨¤¹Îóµó·¿.
Îóµó·¿ #M17NStatus ¤Ï´Ø¿ô m17n_status () ¤ÎÌá¤êÃͤȤ·¤ÆÍѤ¤¤é¤ì¤ë¡£ */
enum M17NStatus
{
/***en No modules is initialized, and all modules are finalized. */
M17N_NOT_INITIALIZED,
/***en Only the modules in CORE API are initialized. */
M17N_CORE_INITIALIZED,
/***en Only the modules in CORE and SHELL APIs are initialized. */
M17N_SHELL_INITIALIZED,
/***en All modules are initialized. */
M17N_GUI_INITIALIZED
};
/*=*/
extern enum M17NStatus m17n_status (void);
/***en @defgroup m17nCore CORE API
@brief API provided by libm17n-core.so */
/***ja @defgroup m17nCore ¥³¥¢ API
@brief libm17n-core.so ¤¬Ä󶡤¹¤ë API */
/*=*/
/*** @ingroup m17nCore */
/***en @defgroup m17nObject Managed Object
@brief Objects managed by the reference count */
/***ja @defgroup m17nObject ´ÉÍý²¼¥ª¥Ö¥¸¥§¥¯¥È
@brief »²¾È²ó¿ô¤Ç´ÉÍý¤µ¤ì¤ë¥ª¥Ö¥¸¥§¥¯¥È */
/*=*/
/*** @ingroup m17nObject */
/***en
@brief The first member of a managed object.
When an application program defines a new structure for managed
objects, its first member must be of the type @c struct
#M17NObjectHead. Its contents are used by the m17n library, and
application programs should never touch them. */
/***ja
@brief ´ÉÍý²¼¥ª¥Ö¥¸¥§¥¯¥È¤ÎºÇ½é¤Î¥á¥ó¥Ð.
¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤¬¿·¤·¤¤¹½Â¤ÂΤò´ÉÍý²¼¥ª¥Ö¥¸¥§¥¯¥È¤È¤·¤ÆÄêµÁ¤¹¤ëºÝ¤Ë¤Ï¡¢ºÇ½é¤Î¥á¥ó¥Ð¤Ï
@c #M17NObjectHead ¹½Â¤Âη¿¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
@c #M17NObjectHead ¤ÎÆâÍÆ¤Ï m17n
¥é¥¤¥Ö¥é¥ê¤¬»ÈÍѤ¹¤ë¤Î¤Ç¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤Ï¿¨¤ì¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ */
typedef struct
{
/*** Hidden from applications. */
void *filler[2];
} M17NObjectHead;
/*=*/
/* Return a newly allocated managed object. */
extern void *m17n_object (int size, void (*freer) (void *));
/* Increment the reference count of managed object OBJECT. */
extern int m17n_object_ref (void *object);
/* Decrement the reference count of managed object OBJECT. */
extern int m17n_object_unref (void *object);
/*** @ingroup m17nCore */
/***en
@brief Generic function type.
#M17NFunc is a generic function type for setting a function
pointer as a value of #MSymbol property or #MPlist. */
/***ja
@brief ÈÆ´Ø¿ô·¿.
#M17NFunc ¤ÏÈÆ´Ø¿ô·¿¤Ç¤¢¤ê¡¢´Ø¿ô¥Ý¥¤¥ó¥¿¤ò #MSymbol ¥×¥í¥Ñ¥Æ¥£¤ä
#MPlist ¤ÎÃͤȤ·¤ÆÀßÄꤹ¤ëºÝÍѤ¤¤ë¡£ */
/***
@seealso
msymbol_put_func (), msymbol_get_func (),
mplist_put_func (), mplist_get_func (). */
typedef void (*M17NFunc) (void);
/*=*/
/*** @ingroup m17nCore */
/***en
@brief Wrapper for a generic function type.
The macro M17N_FUNC () casts a function to the type #M17NFunc. */
/***ja
@brief ÈÆ´Ø¿ô·¿¤Ø¤Î¥é¥Ã¥Ñ.
¥Þ¥¯¥í M17N_FUNC () ¤Ï´Ø¿ô¤ò #M17NFunc ·¿¤Ø¥¥ã¥¹¥È¤¹¤ë¡£ */
#define M17N_FUNC(func) ((M17NFunc) (func))
/*=*/
/* (C2) Symbol handling */
/*** @ingroup m17nCore */
/***en @defgroup m17nSymbol Symbol */
/***ja @defgroup m17nSymbol ¥·¥ó¥Ü¥ë */
/*=*/
/***
@ingroup m17nSymbol */
/***en
@brief Type of symbols.
The type #MSymbol is for a @e symbol object. Its internal
structure is concealed from application programs. */
/***ja
@brief ¥·¥ó¥Ü¥ë¤Î·¿Àë¸À.
#MSymbol ¤Ï @e ¥·¥ó¥Ü¥ë (symbol) ¥ª¥Ö¥¸¥§¥¯¥È¤Î·¿¤Ç¤¢¤ë¡£
ÆâÉô¹½Â¤¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤«¤é¤Ï¸«¤¨¤Ê¤¤¡£ */
typedef struct MSymbolStruct *MSymbol;
/*=*/
/* Predefined symbols. */
extern MSymbol Mnil;
extern MSymbol Mt;
extern MSymbol Mstring;
extern MSymbol Msymbol;
extern MSymbol Mtext;
extern MSymbol Mcharset;
/* Return a symbol of name NAME. */
extern MSymbol msymbol (const char *name);
/* Return a managing key of name NAME. */
extern MSymbol msymbol_as_managing_key (const char *name);
/* Check if SYMBOL is a managing key. */
extern int msymbol_is_managing_key (MSymbol symbol);
/* Return a symbol of name NAME if it already exists. */
extern MSymbol msymbol_exist (const char *name);
/* Return the name of SYMBOL. */
extern char *msymbol_name (MSymbol symbol);
/* Give SYMBOL KEY property with value VALUE. */
extern int msymbol_put (MSymbol symbol, MSymbol key, void *val);
/*** Return KEY property value of SYMBOL. */
extern void *msymbol_get (MSymbol symbol, MSymbol key);
extern int msymbol_put_func (MSymbol symbol, MSymbol key, M17NFunc func);
extern M17NFunc msymbol_get_func (MSymbol symbol, MSymbol key);
/*
* (2-1) Property List
*/
/*=*/
/*** @ingroup m17nCore */
/***en @defgroup m17nPlist Property List */
/***ja @defgroup m17nPlist ¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È */
/*=*/
/***
@ingroup m17nPlist */
/***en
@brief Type of property list objects.
The type #MPlist is for a @e property @e list object. Its internal
structure is concealed from application programs. */
/***ja
@brief ¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È¡¦¥ª¥Ö¥¸¥§¥¯¥È¤Î·¿Àë¸À.
#MPlist ¤Ï @e ¥×¥í¥Ñ¥Æ¥£¥ê¥¹¥È (Property list) ¥ª¥Ö¥¸¥§¥¯¥È¤Î·¿¤Ç¤¢¤ë¡£
ÆâÉô¹½Â¤¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤«¤é¤Ï¸«¤¨¤Ê¤¤¡£ */
typedef struct MPlist MPlist;
/*=*/
extern MSymbol Mplist, Minteger;
extern MPlist *mplist ();
extern MPlist *mplist_copy (MPlist *plist);
extern MPlist *mplist_add (MPlist *plist, MSymbol key, void *val);
extern MPlist *mplist_push (MPlist *plist, MSymbol key, void *val);
extern void *mplist_pop (MPlist *plist);
extern MPlist *mplist_put (MPlist *plist, MSymbol key, void *val);
extern void *mplist_get (MPlist *plist, MSymbol key);
extern MPlist *mplist_put_func (MPlist *plist, MSymbol key, M17NFunc func);
extern M17NFunc mplist_get_func (MPlist *plist, MSymbol key);
extern MPlist *mplist_find_by_key (MPlist *plist, MSymbol key);
extern MPlist *mplist_find_by_value (MPlist *plist, void *val);
extern MPlist *mplist_next (MPlist *plist);
extern MPlist *mplist_set (MPlist *plist, MSymbol key, void *val);
extern int mplist_length (MPlist *plist);
extern MSymbol mplist_key (MPlist *plist);
extern void *mplist_value (MPlist *plist);
/* (S1) Characters */
/*=*/
/*** @ingroup m17nCore */
/***en @defgroup m17nCharacter Character */
/***ja @defgroup m17nCharacter ʸ»ú */
/*=*/
#if !defined (FOR_DOXYGEN) || defined (DOXYGEN_INTERNAL_MODULE)
#define MCHAR_MAX 0x3FFFFF
/*#define MCHAR_MAX 0x7FFFFFFF*/
#endif
extern MSymbol Mscript;
extern MSymbol Mname;
extern MSymbol Mcategory;
extern MSymbol Mcombining_class;
extern MSymbol Mbidi_category;
extern MSymbol Msimple_case_folding;
extern MSymbol Mcomplicated_case_folding;
extern MSymbol Mcased, Msoft_dotted, Mcase_mapping;
extern MSymbol Mblock;
extern MSymbol mchar_define_property (const char *name, MSymbol type);
extern void *mchar_get_prop (int c, MSymbol key);
extern int mchar_put_prop (int c, MSymbol key, void *val);
/* (C3) Handling chartable */
/*** @ingroup m17nCore */
/***en @defgroup m17nChartable Chartable */
/***ja @defgroup m17nChartable ʸ»ú¥Æ¡¼¥Ö¥ë */
/*=*/
extern MSymbol Mchar_table;
/***
@ingroup m17nChartable */
/***en
@brief Type of chartables.
The type #MCharTable is for a @e chartable objects. Its
internal structure is concealed from application programs. */
/***ja
@brief ʸ»ú¥Æ¡¼¥Ö¥ë¤Î·¿Àë¸À.
#MCharTable ¤Ï @e ʸ»ú¥Æ¡¼¥Ö¥ë (chartable) ¥ª¥Ö¥¸¥§¥¯¥È¤Î·¿¤Ç¤¢¤ë¡£
ÆâÉô¹½Â¤¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤«¤é¤Ï¸«¤¨¤Ê¤¤¡£ */
typedef struct MCharTable MCharTable;
/*=*/
extern MCharTable *mchartable (MSymbol key, void *default_value);
extern int mchartable_min_char (MCharTable *table);
extern int mchartable_max_char (MCharTable *table);
extern void *mchartable_lookup (MCharTable *table, int c);
extern int mchartable_set (MCharTable *table, int c, void *val);
extern int mchartable_set_range (MCharTable *table, int from, int to,
void *val);
extern int mchartable_map (MCharTable *table, void *ignore,
void (*func) (int, int, void *, void *),
void *func_arg);
extern void mchartable_range (MCharTable *table, int *from, int *to);
extern MCharTable *mchar_get_prop_table (MSymbol key, MSymbol *type);
/*
* (5) Handling M-text.
* "M" of M-text stands for:
* o Multilingual
* o Metamorphic
* o More than string
*/
/*** @ingroup m17nCore */
/***en @defgroup m17nMtext M-text */
/***ja @defgroup m17nMtext M-text */
/*=*/
/*
* (5-1) M-text basics
*/
/*=*/
/*** @ingroup m17nMtext */
/***en
@brief Type of @e M-texts.
The type #MText is for an @e M-text object. Its internal
structure is concealed from application programs. */
/***ja
@brief @e MText ¤Î·¿Àë¸À.
#Mtext ¤Ï @e M-text ¥ª¥Ö¥¸¥§¥¯¥È¤Î·¿¤Ç¤¢¤ë¡£
ÆâÉô¹½Â¤¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤«¤é¤Ï¸«¤¨¤Ê¤¤¡£
@latexonly \IPAlabel{MText} @endlatexonly
@latexonly \IPAlabel{MText->MPlist} @endlatexonly */
typedef struct MText MText;
/*=*/
/*** @ingroup m17nMtext */
/***en
@brief Enumeration for specifying the format of an M-text.
The enum #MTextFormat is used as an argument of the
mtext_from_data () function to specify the format of data from
which an M-text is created. */
/***ja
@brief M-text ¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤ò»ØÄꤹ¤ëÎóµó·¿.
Îóµó·¿ #MTextFormat ¤Ï´Ø¿ô
mtext_from_data () ¤Î°ú¿ô¤È¤·¤ÆÍѤ¤¤é¤ì¡¢
M-text ¤òÀ¸À®¤¹¤ë¸µ¤È¤Ê¤ë¥Ç¡¼¥¿¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤ò»ØÄꤹ¤ë¡£ */
enum MTextFormat
{
/*** US-ASCII encoding */
MTEXT_FORMAT_US_ASCII,
/*** UTF-8 encoding */
MTEXT_FORMAT_UTF_8,
/*** UTF-16LE encoding */
MTEXT_FORMAT_UTF_16LE,
/*** UTF-16BE encoding */
MTEXT_FORMAT_UTF_16BE,
/*** UTF-32LE encoding */
MTEXT_FORMAT_UTF_32LE,
/*** UTF-32BE encoding */
MTEXT_FORMAT_UTF_32BE,
MTEXT_FORMAT_MAX
};
/*=*/
extern MText *mtext ();
extern void *mtext_data (MText *mt, enum MTextFormat *fmt, int *nunits,
int *pos_idx, int *unit_idx);
/*=*/
/***en @name Variables: Default Endian of UTF-16 and UTF-32 */
/***ja @name ÊÑ¿ô: UTF-16 ¤È UTF-32 ¤Î¥Ç¥Õ¥©¥ë¥È¤Î¥¨¥ó¥Ç¥£¥¢¥ó */
/*** @{ */
/*=*/
/*** @ingroup m17nMtext */
/***en
@brief Variable of value MTEXT_FORMAT_UTF_16LE or MTEXT_FORMAT_UTF_16BE.
The global variable #MTEXT_FORMAT_UTF_16 is initialized to
#MTEXT_FORMAT_UTF_16LE on a "Little Endian" system (storing words
with the least significant byte first), and to
#MTEXT_FORMAT_UTF_16BE on a "Big Endian" system (storing words
with the most significant byte first). */
/***ja
@brief Ãͤ¬ MTEXT_FORMAT_UTF_16LE ¤« MTEXT_FORMAT_UTF_16BE ¤Ç¤¢¤ëÊÑ¿ô
Âç°èÊÑ¿ô #MTEXT_FORMAT_UTF_16 ¤Ï¥ê¥È¥ë¡¦¥¨¥ó¥Ç¥£¥¢¥ó¡¦¥·¥¹¥Æ¥à
¡Ê¥ï¡¼¥É¤ò LSB (Least Significant Byte) ¤òÀè¤Ë¤·¤Æ³ÊǼ¡Ë¾å¤Ç¤Ï
#MTEXT_FORMAT_UTF_16LE ¤Ë½é´ü²½¤µ¤ì¡¢¥Ó¥Ã¥°¡¦¥¨¥ó¥Ç¥£¥¢¥ó¡¦¥·¥¹¥Æ¥à
¡Ê¥ï¡¼¥É¤ò MSB (Most Significant Byte) ¤òÀè¤Ë¤·¤Æ³ÊǼ¡Ë¾å¤Ç¤Ï
#MTEXT_FORMAT_UTF_16BE ¤Ë½é´ü²½¤µ¤ì¤ë¡£ */
/***
@seealso
mtext_from_data () */
extern const enum MTextFormat MTEXT_FORMAT_UTF_16;
/*=*/
/*** @ingroup m17nMtext */
/***en
@brief Variable of value MTEXT_FORMAT_UTF_32LE or MTEXT_FORMAT_UTF_32BE.
The global variable #MTEXT_FORMAT_UTF_32 is initialized to
#MTEXT_FORMAT_UTF_32LE on a "Little Endian" system (storing words
with the least significant byte first), and to
#MTEXT_FORMAT_UTF_32BE on a "Big Endian" system (storing
words with the most significant byte first). */
/***ja
@brief Ãͤ¬ MTEXT_FORMAT_UTF_32LE ¤« MTEXT_FORMAT_UTF_32BE ¤Ç¤¢¤ëÊÑ¿ô
Âç°èÊÑ¿ô #MTEXT_FORMAT_UTF_32 ¤Ï¥ê¥È¥ë¡¦¥¨¥ó¥Ç¥£¥¢¥ó¡¦¥·¥¹¥Æ¥à
¡Ê¥ï¡¼¥É¤ò LSB (Least Significant Byte) ¤òÀè¤Ë¤·¤Æ³ÊǼ¡Ë¾å¤Ç¤Ï
#MTEXT_FORMAT_UTF_32LE ¤Ë½é´ü²½¤µ¤ì¡¢¥Ó¥Ã¥°¡¦¥¨¥ó¥Ç¥£¥¢¥ó¡¦¥·¥¹¥Æ¥à
¡Ê¥ï¡¼¥É¤ò MSB (Most Significant Byte) ¤òÀè¤Ë¤·¤Æ³ÊǼ¡Ë¾å¤Ç¤Ï
#MTEXT_FORMAT_UTF_32BE ¤Ë½é´ü²½¤µ¤ì¤ë¡£ */
/***
@seealso
mtext_from_data () */
extern const int MTEXT_FORMAT_UTF_32;
/*=*/
/*** @} */
/*=*/
extern MText *mtext_from_data (const void *data, int nitems,
enum MTextFormat format);
/*=*/
/*** @} */
extern MSymbol Mlanguage;
/*
* (5-2) Functions to manipulate M-texts. They correspond to string
* manipulating functions in libc.
* In the following functions, mtext_XXX() corresponds to strXXX().
*/
extern int mtext_len (MText *mt);
extern int mtext_ref_char (MText *mt, int pos);
extern int mtext_set_char (MText *mt, int pos, int c);
extern MText *mtext_copy (MText *mt1, int pos, MText *mt2, int from, int to);
extern int mtext_compare (MText *mt1, int from1, int to1,
MText *mt2, int from2, int to2);
extern int mtext_case_compare (MText *mt1, int from1, int to1,
MText *mt2, int from2, int to2);
extern int mtext_character (MText *mt, int from, int to, int c);
extern int mtext_del (MText *mt, int from, int to);
extern int mtext_ins (MText *mt1, int pos, MText *mt2);
extern int mtext_insert (MText *mt1, int pos, MText *mt2, int from, int to);
extern int mtext_ins_char (MText *mt, int pos, int c, int n);
extern int mtext_replace (MText *mt1, int from1, int to1,
MText *mt2, int from2, int to2);
extern MText *mtext_cat_char (MText *mt, int c);
extern MText *mtext_duplicate (MText *mt, int from, int to);
extern MText *mtext_dup (MText *mt);
extern MText *mtext_cat (MText *mt1, MText *mt2);
extern MText *mtext_ncat (MText *mt1, MText *mt2, int n);
extern MText *mtext_cpy (MText *mt1, MText *mt2);
extern MText *mtext_ncpy (MText *mt1, MText *mt2, int n);
extern int mtext_chr (MText *mt, int c);
extern int mtext_rchr (MText *mt, int c);
extern int mtext_cmp (MText *mt1, MText *mt2);
extern int mtext_ncmp (MText *mt1, MText *mt2, int n);
extern int mtext_spn (MText *mt1, MText *mt2);
extern int mtext_cspn (MText *mt1, MText *mt2);
extern int mtext_pbrk (MText *mt1, MText *mt2);
extern int mtext_text (MText *mt1, int pos, MText *mt2);
extern int mtext_search (MText *mt1, int from, int to, MText *mt2);
extern MText *mtext_tok (MText *mt, MText *delim, int *pos);
extern int mtext_casecmp (MText *mt1, MText *mt2);
extern int mtext_ncasecmp (MText *mt1, MText *mt2, int n);
extern int mtext_lowercase (MText *mt);
extern int mtext_titlecase (MText *mt);
extern int mtext_uppercase (MText *mt);
/*** @ingroup m17nMtext */
/***en
@brief Enumeration for specifying a set of line breaking option.
The enum #MTextLineBreakOption is to control the line breaking
algorithm of the function mtext_line_break () by specifying
logical-or of the members in the arg @e option. */
enum MTextLineBreakOption
{
/***en Specify the legacy support for space character as base for
combining marks. See the section 8.3 of UAX#14. */
MTEXT_LBO_SP_CM = 1,
/***en Specify to use space characters for line breaking Korean
text. */
MTEXT_LBO_KOREAN_SP = 2,
/***en Specify to treat characters of ambiguous line-breaking
class as of ideographic line-breaking class. */
MTEXT_LBO_AI_AS_ID = 4,
MTEXT_LBO_MAX
};
extern int mtext_line_break (MText *mt, int pos, int option, int *after);
/*** @ingroup m17nPlist */
extern MPlist *mplist_deserialize (MText *mt);
/*
* (5-3) Text properties
*/
/*=*/
/*** @ingroup m17nCore */
/***en @defgroup m17nTextProperty Text Property */
/***ja @defgroup m17nTextProperty ¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£ */
/*=*/
/*** @ingroup m17nTextProperty */
/***en
@brief Flag bits to control text property.
The mtext_property () function accepts logical OR of these flag
bits as an argument. They control the behaviour of the created
text property as described in the documentation of each flag
bit. */
/***ja
@brief ¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤òÀ©¸æ¤¹¤ë¥Õ¥é¥°¥Ó¥Ã¥È.
´Ø¿ô mtext_property () ¤Ï°Ê²¼¤Î¥Õ¥é¥°¥Ó¥Ã¥È¤ÎÏÀÍý
OR ¤ò°ú¿ô¤È¤·¤Æ¤È¤ë¤³¤È¤¬¤Ç¤¤ë¡£
¥Õ¥é¥°¥Ó¥Ã¥È¤ÏÀ¸À®¤µ¤ì¤¿¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤Î¿¶Éñ¤¤¤òÀ©¸æ¤¹¤ë¡£
¾ÜºÙ¤Ï³Æ¥Õ¥é¥°¥Ó¥Ã¥È¤ÎÀâÌÀ¤ò»²¾È¡£*/
enum MTextPropertyControl
{
/***en If this flag bit is on, an M-text inserted at the start
position or at the middle of the text property inherits the
text property. */
/***ja ¤³¤Î¥Ó¥Ã¥È¤¬ on ¤Ê¤é¤Ð¡¢¤³¤Î¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤Î»Ï¤Þ¤ëÅÀ¤¢¤ë¤¤¤ÏÃæ´Ö¤ËÁÞÆþ¤µ¤ì¤¿
M-text ¤Ï¤³¤Î¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤ò·Ñ¾µ¤¹¤ë¡£
*/
MTEXTPROP_FRONT_STICKY = 0x01,
/***en If this flag bit is on, an M-text inserted at the end
position or at the middle of the text property inherits the
text property. */
/***ja ¤³¤Î¥Ó¥Ã¥È¤¬ on ¤Ê¤é¤Ð¡¢¤³¤Î¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤Î½ª¤ï¤ëÅÀ¤¢¤ë¤¤¤ÏÃæ´Ö¤ËÁÞÆþ¤µ¤ì¤¿
M-text ¤Ï¤³¤Î¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤ò·Ñ¾µ¤¹¤ë¡£
*/
MTEXTPROP_REAR_STICKY = 0x02,
/***en If this flag bit is on, the text property is removed if a
text in its region is modified. */
/***ja ¤³¤Î¥Ó¥Ã¥È¤¬ on ¤Ê¤é¤Ð¡¢¤³¤Î¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤ÎÈÏ°ÏÆâ¤Î¥Æ¥¥¹¥È¤¬Êѹ¹¤µ¤ì¤¿¾ì¹ç¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤Ï¼è¤ê½ü¤«¤ì¤ë¡£ */
MTEXTPROP_VOLATILE_WEAK = 0x04,
/***en If this flag bit is on, the text property is removed if a
text or the other text property in its region is modified. */
/***ja ¤³¤Î¥Ó¥Ã¥È¤¬ on ¤Ê¤é¤Ð¡¢¤³¤Î¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤ÎÈÏ°ÏÆâ¤Î¥Æ¥¥¹¥È¤¢¤ë¤¤¤ÏÊ̤Υƥ¥¹¥È¥×¥í¥Ñ¥Æ¥£¤¬Êѹ¹¤µ¤ì¤¿¾ì¹ç¤³¤Î¥Æ¥
¥¹¥È¥×¥í¥Ñ¥Æ¥£¤Ï¼è¤ê½ü¤«¤ì¤ë¡£*/
MTEXTPROP_VOLATILE_STRONG = 0x08,
/***en If this flag bit is on, the text property is not
automatically merged with the others. */
/***ja ¤³¤Î¥Ó¥Ã¥È¤¬ on ¤Ê¤é¤Ð¡¢¤³¤Î¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤Ï¾¤Î¥×¥í¥Ñ¥Æ¥£¤È¼«Æ°Åª¤Ë¤Ï¥Þ¡¼¥¸¤µ¤ì¤Ê¤¤¡£ */
MTEXTPROP_NO_MERGE = 0x10,
MTEXTPROP_CONTROL_MAX = 0x1F
};
/*=*/
extern MSymbol Mtext_prop_serializer;
extern MSymbol Mtext_prop_deserializer;
/*** @ingroup m17nTextProperty */
/***en
@brief Type of serializer functions.
This is the type of serializer functions. If the key of a symbol
property is #Mtext_prop_serializer, the value must be of this
type.
@seealso
mtext_serialize (), #Mtext_prop_serializer
*/
/***ja
@brief ¥·¥ê¥¢¥é¥¤¥¶´Ø¿ô¤Î·¿Àë¸À.
¥·¥ê¥¢¥é¥¤¥¶´Ø¿ô¤Î·¿¤Ç¤¢¤ë¡£ ¤¢¤ë¥·¥ó¥Ü¥ë¤Î¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤¬ @c
#Mtext_prop_serializer ¤Ç¤¢¤ë¤È¤¡¢ ÃͤϤ³¤Î·¿¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
@seealso
mtext_serialize (), #Mtext_prop_serializer
*/
typedef MPlist *(*MTextPropSerializeFunc) (void *val);
/*** @ingroup m17nTextProperty */
/***en
@brief Type of deserializer functions.
This is the type of deserializer functions. If the key of a
symbol property is #Mtext_prop_deserializer, the value must be of
this type.
@seealso
mtext_deserialize (), #Mtext_prop_deserializer
*/
/***ja
@brief ¥Ç¥·¥ê¥¢¥é¥¤¥¶´Ø¿ô¤Î·¿Àë¸À.
¥Ç¥·¥ê¥¢¥é¥¤¥¶´Ø¿ô¤Î·¿¤Ç¤¢¤ë¡£ ¤¢¤ë¥·¥ó¥Ü¥ë¤Î¥×¥í¥Ñ¥Æ¥£¤Î¥¡¼¤¬ @c
#Mtext_prop_deserializer ¤Ç¤¢¤ë¤È¤¡¢ ÃͤϤ³¤Î·¿¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
@seealso
Mtext_prop_deserialize (), Mtext_prop_deserializer
*/
typedef void *(*MTextPropDeserializeFunc) (MPlist *plist);
extern void *mtext_get_prop (MText *mt, int pos, MSymbol key);
extern int mtext_get_prop_values (MText *mt, int pos, MSymbol key,
void **values, int num);
extern int mtext_get_prop_keys (MText *mt, int pos, MSymbol **keys);
extern int mtext_put_prop (MText *mt, int from, int to,
MSymbol key, void *val);
extern int mtext_put_prop_values (MText *mt, int from, int to,
MSymbol key, void **values, int num);
extern int mtext_push_prop (MText *mt, int from, int to,
MSymbol key, void *val);
extern int mtext_pop_prop (MText *mt, int from, int to,
MSymbol key);
extern int mtext_prop_range (MText *mt, MSymbol key, int pos,
int *from, int *to, int deeper);
/*=*/
/***
@ingroup m17nTextProperty */
/***en
@brief Type of text properties.
The type #MTextProperty is for a @e text @e property objects. Its
internal structure is concealed from application programs. */
/***ja
@brief @c ¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£¤Î·¿Àë¸À.
#MTextProperty ¤Ï @e ¥Æ¥¥¹¥È¥×¥í¥Ñ¥Æ¥£ ¥ª¥Ö¥¸¥§¥¯¥È¤Î·¿¤Ç¤¢¤ë¡£
ÆâÉô¹½Â¤¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤«¤é¤Ï¸«¤¨¤Ê¤¤¡£ */
typedef struct MTextProperty MTextProperty;
/*=*/
extern MTextProperty *mtext_property (MSymbol key, void *val,
int control_bits);
extern MText *mtext_property_mtext (MTextProperty *prop);
extern MSymbol mtext_property_key (MTextProperty *prop);
extern void *mtext_property_value (MTextProperty *prop);
extern int mtext_property_start (MTextProperty *prop);
extern int mtext_property_end (MTextProperty *prop);
extern MTextProperty *mtext_get_property (MText *mt, int pos, MSymbol key);
extern int mtext_get_properties (MText *mt, int pos, MSymbol key,
MTextProperty **props, int num);
extern int mtext_attach_property (MText *mt, int from, int to,
MTextProperty *prop);
extern int mtext_detach_property (MTextProperty *prop);
extern int mtext_push_property (MText *mt, int from, int to,
MTextProperty *prop);
extern MText *mtext_serialize (MText *mt, int from, int to,
MPlist *property_list);
extern MText *mtext_deserialize (MText *mt);
/*** @ingroup m17nCore */
/***en @defgroup m17nDatabase Database */
/***ja @defgroup m17nDatabase ¥Ç¡¼¥¿¥Ù¡¼¥¹ */
/*=*/
/* Directory of an application specific databases. */
extern char *mdatabase_dir;
/*=*/
/***
@ingroup m17nDatabase */
/***en
@brief Type of database.
The type #MDatabase is for a database object. Its internal
structure is concealed from an application program. */
/***ja
@brief ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î·¿Àë¸À.
#MDatabase ·¿¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¥ª¥Ö¥¸¥§¥¯¥ÈÍѤι½Â¤ÂΤǤ¢¤ë¡£
ÆâÉô¹½Â¤¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤«¤é¤Ï¸«¤¨¤Ê¤¤¡£
*/
typedef struct MDatabase MDatabase;
/*=*/
/* Look for a data. */
extern MDatabase *mdatabase_find (MSymbol tag1, MSymbol tag2,
MSymbol tag3, MSymbol tag4);
extern MPlist *mdatabase_list (MSymbol tag0, MSymbol tag1,
MSymbol tag2, MSymbol tag3);
/* Load a data. */
void *mdatabase_load (MDatabase *mdb);
/* Get tags of a data. */
extern MSymbol *mdatabase_tag (MDatabase *mdb);
/* Define a data. */
extern MDatabase *mdatabase_define (MSymbol tag1, MSymbol tag2,
MSymbol tag3, MSymbol tag4,
void *(*loader) (MSymbol *, void *),
void *extra_info);
M17N_END_HEADER
#endif /* _M17N_CORE_H_ */
/*
Local Variables:
coding: euc-japan
End:
*/
|