*** empty log message ***
[m17n/m17n-lib.git] / src / m17n-misc.h
1 /* m17n-misc.h -- header file for the MISC API.
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_ERR_H_
24 #define _M17N_ERR_H_
25
26 /*** @defgroup m17nMisc MISC API */
27 /*=*/
28 /*** @ingroup m17nMisc  */
29 /***en @defgroup m17nError Error Handling */
30 /***ja @defgroup m17nError ¥¨¥é¡¼½èÍý  */
31 /*=*/
32
33 /*** @ingroup m17nError */
34 /***en 
35     @brief Enumeration for error code of the m17n library.
36
37     Enumeration for error code of the m17n library.
38
39     When a library function is called with an invalid argument, it
40     sets the external variable @e merror_code to one of these values.
41     All the error codes are positive integers.
42
43     When a memory allocation error happens, the function pointed to by
44     the external variable #m17n_memory_full_handler is called with one
45     of these values as an argument.  */
46
47 /***ja 
48     @brief m17n ¥é¥¤¥Ö¥é¥ê¥¨¥é¡¼¥³¡¼¥É¤ÎÎóµó
49
50     m17n ¥é¥¤¥Ö¥é¥ê¥¨¥é¡¼¥³¡¼¥É¤ÎÎóµó
51
52     ¥é¥¤¥Ö¥é¥ê¤Î´Ø¿ô¤¬ÂÅÅö¤Ç¤Ê¤¤°ú¿ô¤È¤È¤â¤Ë¸Æ¤Ð¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢ÊÑ¿ô @c
53     merror_code ¤ò¤³¤ì¤é¤ÎÃͤΤɤ줫¤Ë¥»¥Ã¥È¤¹¤ë¡£¤¹¤Ù¤Æ¤Î¥¨¥é¡¼¥³¡¼¥É
54     ¤ÏÀµ¤ÎÀ°¿ô¤Ç¤¢¤ë¡£
55
56     ¥á¥â¥ê³äÅö¤Æ¥¨¥é¡¼¤ÎºÝ¤Ë¤Ï¡¢³°ÉôÊÑ¿ô #m17n_memory_full_handler ¤Î»Ø
57     ¤¹´Ø¿ô¤¬¡¢¤³¤ì¤é¤ÎÃͤΤ¦¤Á¤Î¤É¤ì¤«¤ò°ú¿ô¤È¤·¤Æ¸Æ¤Ð¤ì¤ë¡£
58     */
59
60 enum MErrorCode
61   {
62     MERROR_NONE,
63     MERROR_OBJECT,
64     MERROR_SYMBOL,
65     MERROR_MTEXT,
66     MERROR_TEXTPROP,
67     MERROR_CHAR,
68     MERROR_CHARTABLE,
69     MERROR_CHARSET,
70     MERROR_CODING,
71     MERROR_RANGE,
72     MERROR_LANGUAGE,
73     MERROR_LOCALE,
74     MERROR_PLIST,
75     MERROR_MISC,
76     MERROR_WIN,
77     MERROR_X,
78     MERROR_FRAME,
79     MERROR_FACE,
80     MERROR_DRAW,
81     MERROR_FONT,
82     MERROR_FONTSET,
83     MERROR_FONT_OTF,
84     MERROR_FONT_FT,
85     MERROR_IM,
86     MERROR_DB,
87     MERROR_IO,
88     MERROR_DEBUG,
89     MERROR_MEMORY,
90     MERROR_MAX
91   };
92
93 /*=*/
94
95 extern enum MErrorCode merror_code;
96
97 extern void (*m17n_memory_full_handler) (enum MErrorCode err);
98
99 /*=*/
100 /*** @ingroup m17nMisc  */
101 /***en @defgroup m17nDebug Debugging */
102 /***ja @defgroup m17nDebug ¥Ç¥Ð¥Ã¥°¥µ¥Ý¡¼¥È */
103 /*=*/
104
105 extern int mdebug_hook (void);
106
107 extern MSymbol mdebug_dump_symbol (MSymbol sym, int indent);
108 extern MSymbol mdebug_dump_all_symbols (int indent);
109 extern MPlist *mdebug_dump_plist (MPlist *plist, int indent);
110 extern MText *mdebug_dump_mtext (MText *mt, int fullp, int indent);
111 extern MCharTable *mdebug_dump_chartab (MCharTable *table, int indent);
112
113 #ifdef DOXYGEN_INTERNAL_MODULE
114 /***en @defgroup m17nInternal Internal */
115 /***ja @defgroup m17nInternal Internal */
116 #endif
117 #endif /* _M17N_ERR_H_ */
118
119 /*
120   Local Variables:
121   coding: euc-japan
122   End:
123 */