#ifndef UCDN_H
#define UCDN_H
+
+
#if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__MINGW32__)
# define HB_BEGIN_VISIBILITY _Pragma ("GCC visibility push(hidden)")
# define HB_END_VISIBILITY _Pragma ("GCC visibility pop")
HB_BEGIN_HEADER
-#if !defined (HB_DONT_DEFINE_STDINT)
-
#if defined (_SVR4) || defined (SVR4) || defined (__OpenBSD__) || \
defined (_sgi) || defined (__sun) || defined (sun) || \
defined (__digital__) || defined (__HP_cc)
# include <inttypes.h>
#elif defined (_AIX)
# include <sys/inttypes.h>
-/* VS 2010 (_MSC_VER 1600) has stdint.h */
#elif defined (_MSC_VER) && _MSC_VER < 1600
+/* VS 2010 (_MSC_VER 1600) has stdint.h */
typedef __int8 int8_t;
typedef unsigned __int8 uint8_t;
typedef __int16 int16_t;
# include <stdint.h>
#endif
-#endif
#define UCDN_EAST_ASIAN_F 0
#define UCDN_EAST_ASIAN_H 1
#define UCDN_SCRIPT_MULTANI 129
#define UCDN_SCRIPT_OLD_HUNGARIAN 130
#define UCDN_SCRIPT_SIGNWRITING 131
+#define UCDN_SCRIPT_ADLAM 132
+#define UCDN_SCRIPT_BHAIKSUKI 133
+#define UCDN_SCRIPT_MARCHEN 134
+#define UCDN_SCRIPT_NEWA 135
+#define UCDN_SCRIPT_OSAGE 136
+#define UCDN_SCRIPT_TANGUT 137
+#define UCDN_SCRIPT_MASARAM_GONDI 138
+#define UCDN_SCRIPT_NUSHU 139
+#define UCDN_SCRIPT_SOYOMBO 140
+#define UCDN_SCRIPT_ZANABAZAR_SQUARE 141
+#define UCDN_SCRIPT_DOGRA 142
+#define UCDN_SCRIPT_GUNJALA_GONDI 143
+#define UCDN_SCRIPT_HANIFI_ROHINGYA 144
+#define UCDN_SCRIPT_MAKASAR 145
+#define UCDN_SCRIPT_MEDEFAIDRIN 146
+#define UCDN_SCRIPT_OLD_SOGDIAN 147
+#define UCDN_SCRIPT_SOGDIAN 148
+#define UCDN_SCRIPT_ELYMAIC 149
+#define UCDN_SCRIPT_NANDINAGARI 150
+#define UCDN_SCRIPT_NYIAKENG_PUACHUE_HMONG 151
+#define UCDN_SCRIPT_WANCHO 152
+
+#define UCDN_LINEBREAK_CLASS_OP 0
+#define UCDN_LINEBREAK_CLASS_CL 1
+#define UCDN_LINEBREAK_CLASS_CP 2
+#define UCDN_LINEBREAK_CLASS_QU 3
+#define UCDN_LINEBREAK_CLASS_GL 4
+#define UCDN_LINEBREAK_CLASS_NS 5
+#define UCDN_LINEBREAK_CLASS_EX 6
+#define UCDN_LINEBREAK_CLASS_SY 7
+#define UCDN_LINEBREAK_CLASS_IS 8
+#define UCDN_LINEBREAK_CLASS_PR 9
+#define UCDN_LINEBREAK_CLASS_PO 10
+#define UCDN_LINEBREAK_CLASS_NU 11
+#define UCDN_LINEBREAK_CLASS_AL 12
+#define UCDN_LINEBREAK_CLASS_HL 13
+#define UCDN_LINEBREAK_CLASS_ID 14
+#define UCDN_LINEBREAK_CLASS_IN 15
+#define UCDN_LINEBREAK_CLASS_HY 16
+#define UCDN_LINEBREAK_CLASS_BA 17
+#define UCDN_LINEBREAK_CLASS_BB 18
+#define UCDN_LINEBREAK_CLASS_B2 19
+#define UCDN_LINEBREAK_CLASS_ZW 20
+#define UCDN_LINEBREAK_CLASS_CM 21
+#define UCDN_LINEBREAK_CLASS_WJ 22
+#define UCDN_LINEBREAK_CLASS_H2 23
+#define UCDN_LINEBREAK_CLASS_H3 24
+#define UCDN_LINEBREAK_CLASS_JL 25
+#define UCDN_LINEBREAK_CLASS_JV 26
+#define UCDN_LINEBREAK_CLASS_JT 27
+#define UCDN_LINEBREAK_CLASS_RI 28
+#define UCDN_LINEBREAK_CLASS_AI 29
+#define UCDN_LINEBREAK_CLASS_BK 30
+#define UCDN_LINEBREAK_CLASS_CB 31
+#define UCDN_LINEBREAK_CLASS_CJ 32
+#define UCDN_LINEBREAK_CLASS_CR 33
+#define UCDN_LINEBREAK_CLASS_LF 34
+#define UCDN_LINEBREAK_CLASS_NL 35
+#define UCDN_LINEBREAK_CLASS_SA 36
+#define UCDN_LINEBREAK_CLASS_SG 37
+#define UCDN_LINEBREAK_CLASS_SP 38
+#define UCDN_LINEBREAK_CLASS_XX 39
+#define UCDN_LINEBREAK_CLASS_ZWJ 40
+#define UCDN_LINEBREAK_CLASS_EB 41
+#define UCDN_LINEBREAK_CLASS_EM 42
#define UCDN_GENERAL_CATEGORY_CC 0
#define UCDN_GENERAL_CATEGORY_CF 1
#define UCDN_BIDI_CLASS_FSI 21
#define UCDN_BIDI_CLASS_PDI 22
+#define UCDN_BIDI_PAIRED_BRACKET_TYPE_OPEN 0
+#define UCDN_BIDI_PAIRED_BRACKET_TYPE_CLOSE 1
+#define UCDN_BIDI_PAIRED_BRACKET_TYPE_NONE 2
+
/**
* Return version of the Unicode database.
*
int ucdn_get_script(uint32_t code);
/**
+ * Get unresolved linebreak class of a codepoint. This does not take
+ * rule LB1 of UAX#14 into account. See ucdn_get_resolved_linebreak_class()
+ * for resolved linebreak classes.
+ *
+ * @param code Unicode codepoint
+ * @return value according to UCDN_LINEBREAK_* and as defined in UAX#14.
+ */
+int ucdn_get_linebreak_class(uint32_t code);
+
+/**
+ * Get resolved linebreak class of a codepoint. This resolves characters
+ * in the AI, SG, XX, SA and CJ classes according to rule LB1 of UAX#14.
+ * In addition the CB class is resolved as the equivalent B2 class and
+ * the NL class is resolved as the equivalent BK class.
+ *
+ * @param code Unicode codepoint
+ * @return value according to UCDN_LINEBREAK_* and as defined in UAX#14.
+ */
+int ucdn_get_resolved_linebreak_class(uint32_t code);
+
+/**
* Check if codepoint can be mirrored.
*
* @param code Unicode codepoint
uint32_t ucdn_mirror(uint32_t code);
/**
+ * Get paired bracket for a codepoint.
+ *
+ * @param code Unicode codepoint
+ * @return paired bracket codepoint or the original codepoint if no
+ * paired bracket character exists
+ */
+uint32_t ucdn_paired_bracket(uint32_t code);
+
+/**
+ * Get paired bracket type for a codepoint.
+ *
+ * @param code Unicode codepoint
+ * @return value according to UCDN_BIDI_PAIRED_BRACKET_TYPE_* and as defined
+ * in UAX#9.
+ *
+ */
+int ucdn_paired_bracket_type(uint32_t code);
+
+/**
* Pairwise canonical decomposition of a codepoint. This includes
* Hangul Jamo decomposition (see chapter 3.12 of the Unicode core
* specification).