Copyright years udpated.
[m17n/m17n-lib.git] / src / internal-flt.h
1 /* internal-flt.h -- common header file for the internal FLT API.
2    Copyright (C) 2007, 2008, 2009, 2010
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., 51 Franklin Street, Fifth Floor,
21    02111-1307, USA.  */
22
23 #ifndef _M_INTERNAL_FLT_H
24 #define _M_INTERNAL_FLT_H
25
26 #define MAKE_COMBINING_CODE(base_y, base_x, add_y, add_x, off_y, off_x) \
27   (((off_y) << 16)                                                      \
28    | ((off_x) << 8)                                                     \
29    | ((base_x) << 6)                                                    \
30    | ((base_y) << 4)                                                    \
31    | ((add_x) << 2)                                                     \
32    | (add_y))
33
34 #define COMBINING_CODE_OFF_Y(code) ((((code) >> 16) & 0xFF) - 128)
35 #define COMBINING_CODE_OFF_X(code) ((((code) >> 8) & 0xFF) - 128)
36 #define COMBINING_CODE_BASE_X(code) (((code) >> 6) & 0x3)
37 #define COMBINING_CODE_BASE_Y(code) (((code) >> 4) & 0x3)
38 #define COMBINING_CODE_ADD_X(code) (((code) >> 2) & 0x3)
39 #define COMBINING_CODE_ADD_Y(code) ((code) & 0x3)
40
41 #define PACK_OTF_TAG(TAG)               \
42   ((((TAG) & 0x7F000000) >> 3)  \
43    | (((TAG) & 0x7F0000) >> 2)  \
44    | (((TAG) & 0x7F00) >> 1)    \
45    | ((TAG) & 0x7F))
46
47 extern MSymbol Mcombining;
48
49 #endif /* _M_INTERNAL_FLT_H */