*** empty log message ***
[m17n/m17n-lib.git] / src / m17n-core.h
index 9f0f4c5..e794d8a 100644 (file)
@@ -1,5 +1,5 @@
 /* m17n-core.h -- header file for the CORE API of the m17n library.
-   Copyright (C) 2003, 2004
+   Copyright (C) 2003, 2004, 2005, 2006
      National Institute of Advanced Industrial Science and Technology (AIST)
      Registration Number H15PRO112
 
@@ -17,7 +17,7 @@
 
    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., 59 Temple Place, Suite 330, Boston, MA
+   Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    02111-1307, USA.  */
 
 #ifndef _M17N_CORE_H_
@@ -42,8 +42,8 @@ extern "C"
 
 #define M17NLIB_MAJOR_VERSION 1
 #define M17NLIB_MINOR_VERSION 3
-#define M17NLIB_PATCH_LEVEL 0
-#define M17NLIB_VERSION_NAME "1.3.0"
+#define M17NLIB_PATCH_LEVEL 5
+#define M17NLIB_VERSION_NAME "1.3.5"
 
 extern void m17n_init_core (void);
 #define M17N_INIT() m17n_init_core ()
@@ -122,6 +122,43 @@ 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.  */
+
+/***en
+    @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 */
@@ -177,6 +214,10 @@ 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
  */
@@ -220,6 +261,10 @@ 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);
@@ -440,6 +485,8 @@ extern MText *mtext_from_data (const void *data, int nitems,
 /*=*/
 /*** @} */
 
+extern MSymbol Mlanguage;
+
 /*
  *  (5-2) Functions to manipulate M-texts.  They correspond to string
  *   manipulating functions in libc.
@@ -511,6 +558,35 @@ 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);
+
+/***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);
 
@@ -526,7 +602,7 @@ extern MPlist *mplist_deserialize (MText *mt);
 /***en
     @brief Flag bits to control text property.
 
-    The mtext_property () funciton accepts logical OR of these flag
+    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.  */