(mflt_dump_gstring): Document it.
[m17n/m17n-lib.git] / src / m17n-core.h
index fdd465a..da5cdf2 100644 (file)
@@ -1,5 +1,5 @@
 /* m17n-core.h -- header file for the CORE API of the m17n library.
 /* m17n-core.h -- header file for the CORE API of the m17n library.
-   Copyright (C) 2003, 2004, 2005, 2006
+   Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
      National Institute of Advanced Industrial Science and Technology (AIST)
      Registration Number H15PRO112
 
      National Institute of Advanced Industrial Science and Technology (AIST)
      Registration Number H15PRO112
 
 #define _M17N_CORE_H_
 
 #ifdef __cplusplus
 #define _M17N_CORE_H_
 
 #ifdef __cplusplus
-extern "C"
-{
+#define M17N_BEGIN_HEADER extern "C" {
+#define M17N_END_HEADER }
+#else
+#define M17N_BEGIN_HEADER      /* do nothing */
+#define M17N_END_HEADER                /* do nothing */
 #endif
 
 #endif
 
+M17N_BEGIN_HEADER
+
 /*
  * Header file for m17n library.
  */
 /*
  * Header file for m17n library.
  */
@@ -41,15 +46,17 @@ extern "C"
 #if !defined (FOR_DOXYGEN) || defined (DOXYGEN_INTERNAL_MODULE)
 
 #define M17NLIB_MAJOR_VERSION 1
 #if !defined (FOR_DOXYGEN) || defined (DOXYGEN_INTERNAL_MODULE)
 
 #define M17NLIB_MAJOR_VERSION 1
-#define M17NLIB_MINOR_VERSION 3
-#define M17NLIB_PATCH_LEVEL 5
-#define M17NLIB_VERSION_NAME "1.3.5"
+#define M17NLIB_MINOR_VERSION 6
+#define M17NLIB_PATCH_LEVEL 1
+#define M17NLIB_VERSION_NAME "1.6.1"
 
 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 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
 
 /*=*/
 #endif
 
 /*=*/
@@ -82,12 +89,16 @@ enum M17NStatus
 
 extern enum M17NStatus m17n_status (void);
 
 
 extern enum M17NStatus m17n_status (void);
 
-/***en @defgroup m17nCore CORE API  */
-/***ja @defgroup m17nCore ¥³¥¢ API */
+/***en @defgroup m17nCore CORE API
+    @brief API provided by libm17n-core.so */
+/***ja @defgroup m17nCore ¥³¥¢ API
+    @brief libm17n-core.so ¤¬Ä󶡤¹¤ë API */
 /*=*/
 /*** @ingroup m17nCore */
 /*=*/
 /*** @ingroup m17nCore */
-/***en @defgroup m17nObject Managed Object */
-/***ja @defgroup m17nObject ´ÉÍý²¼¥ª¥Ö¥¸¥§¥¯¥È */
+/***en @defgroup m17nObject Managed Object
+    @brief Objects managed by the reference count */
+/***ja @defgroup m17nObject ´ÉÍý²¼¥ª¥Ö¥¸¥§¥¯¥È
+    @brief »²¾È²ó¿ô¤Ç´ÉÍý¤µ¤ì¤ë¥ª¥Ö¥¸¥§¥¯¥È */
 /*=*/
 
 /*** @ingroup m17nObject  */
 /*=*/
 
 /*** @ingroup m17nObject  */
@@ -108,6 +119,7 @@ extern enum M17NStatus m17n_status (void);
 
 typedef struct
 {
 
 typedef struct
 {
+  /*** Hidden from applications.  */
   void *filler[2];
 } M17NObjectHead;
 
   void *filler[2];
 } M17NObjectHead;
 
@@ -129,6 +141,13 @@ extern int m17n_object_unref (void *object);
     #M17NFunc is a generic function type for setting a function
     pointer as a value of #MSymbol property or #MPlist.  */
 
     #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 (),
 /***
     @seealso
     msymbol_put_func (), msymbol_get_func (),
@@ -142,7 +161,13 @@ typedef void (*M17NFunc) (void);
 /***en
     @brief Wrapper for a generic function type.
 
 /***en
     @brief Wrapper for a generic function type.
 
-    The macro M17N_FUNC () is to cast a function to type #M17NFunc.  */
+    The macro M17N_FUNC () casts a function to the type #M17NFunc.  */
+
+/***ja
+    @brief ÈÆ´Ø¿ô·¿¤Ø¤Î¥é¥Ã¥Ñ.
+
+    ¥Þ¥¯¥í M17N_FUNC () ¤Ï´Ø¿ô¤ò #M17NFunc ·¿¤Ø¥­¥ã¥¹¥È¤¹¤ë¡£  */
+
 
 #define M17N_FUNC(func) ((M17NFunc) (func))
 
 
 #define M17N_FUNC(func) ((M17NFunc) (func))
 
@@ -179,6 +204,7 @@ extern MSymbol Mt;
 extern MSymbol Mstring;
 extern MSymbol Msymbol;
 extern MSymbol Mtext;
 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 symbol of name NAME.  */
 extern MSymbol msymbol (const char *name);
@@ -286,6 +312,8 @@ extern MSymbol Mcombining_class;
 extern MSymbol Mbidi_category;
 extern MSymbol Msimple_case_folding;
 extern MSymbol Mcomplicated_case_folding;
 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 MSymbol mchar_define_property (const char *name, MSymbol type);
 
@@ -320,6 +348,10 @@ typedef struct MCharTable MCharTable;
 
 extern MCharTable *mchartable (MSymbol key, void *default_value);
 
 
 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 void *mchartable_lookup (MCharTable *table, int c);
 
 extern int mchartable_set (MCharTable *table, int c, void *val);
@@ -389,11 +421,17 @@ typedef struct MText MText;
 
 enum MTextFormat
   {
 
 enum MTextFormat
   {
+    /*** US-ASCII encoding */
     MTEXT_FORMAT_US_ASCII,
     MTEXT_FORMAT_US_ASCII,
+    /*** UTF-8 encoding */
     MTEXT_FORMAT_UTF_8,
     MTEXT_FORMAT_UTF_8,
+    /*** UTF-16LE encoding  */
     MTEXT_FORMAT_UTF_16LE,
     MTEXT_FORMAT_UTF_16LE,
+    /*** UTF-16BE encoding  */
     MTEXT_FORMAT_UTF_16BE,
     MTEXT_FORMAT_UTF_16BE,
+    /*** UTF-32LE encoding  */
     MTEXT_FORMAT_UTF_32LE,
     MTEXT_FORMAT_UTF_32LE,
+    /*** UTF-32BE encoding  */
     MTEXT_FORMAT_UTF_32BE,
     MTEXT_FORMAT_MAX
   };
     MTEXT_FORMAT_UTF_32BE,
     MTEXT_FORMAT_MAX
   };
@@ -551,6 +589,7 @@ extern int mtext_titlecase (MText *mt);
 
 extern int mtext_uppercase (MText *mt);
 
 
 extern int mtext_uppercase (MText *mt);
 
+/*** @ingroup m17nMtext */
 /***en
     @brief Enumeration for specifying a set of line breaking option.
 
 /***en
     @brief Enumeration for specifying a set of line breaking option.
 
@@ -682,7 +721,7 @@ typedef MPlist *(*MTextPropSerializeFunc) (void *val);
     @brief ¥Ç¥·¥ê¥¢¥é¥¤¥¶´Ø¿ô¤Î·¿Àë¸À.
 
     ¥Ç¥·¥ê¥¢¥é¥¤¥¶´Ø¿ô¤Î·¿¤Ç¤¢¤ë¡£ ¤¢¤ë¥·¥ó¥Ü¥ë¤Î¥×¥í¥Ñ¥Æ¥£¤Î¥­¡¼¤¬ @c
     @brief ¥Ç¥·¥ê¥¢¥é¥¤¥¶´Ø¿ô¤Î·¿Àë¸À.
 
     ¥Ç¥·¥ê¥¢¥é¥¤¥¶´Ø¿ô¤Î·¿¤Ç¤¢¤ë¡£ ¤¢¤ë¥·¥ó¥Ü¥ë¤Î¥×¥í¥Ñ¥Æ¥£¤Î¥­¡¼¤¬ @c
-    #Msymbol_prop_deserializer ¤Ç¤¢¤ë¤È¤­¡¢ ÃͤϤ³¤Î·¿¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
+    #Mtext_prop_deserializer ¤Ç¤¢¤ë¤È¤­¡¢ ÃͤϤ³¤Î·¿¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
 
     @seealso
     Mtext_prop_deserialize (), Mtext_prop_deserializer
 
     @seealso
     Mtext_prop_deserialize (), Mtext_prop_deserializer
@@ -760,9 +799,52 @@ extern MText *mtext_serialize (MText *mt, int from, int to,
 
 extern MText *mtext_deserialize (MText *mt);
 
 
 extern MText *mtext_deserialize (MText *mt);
 
-#ifdef __cplusplus
-}
-#endif
+/*** @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_ */
 
 
 #endif /* _M17N_CORE_H_ */