(make_locale): Fix setting of members of locale.
[m17n/m17n-lib.git] / src / m17n-core.h
index f05f62b..e794d8a 100644 (file)
@@ -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 1
-#define M17NLIB_VERSION_NAME "1.3.1"
+#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.
@@ -555,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.  */