- return ufuncs->parent;
-}
-
-
-#define IMPLEMENT(return_type, name) \
- \
-void \
-hb_unicode_funcs_set_##name##_func (hb_unicode_funcs_t *ufuncs, \
- hb_unicode_get_##name##_func_t func, \
- void *user_data, \
- hb_destroy_func_t destroy) \
-{ \
- if (ufuncs->immutable) \
- return; \
- \
- if (ufuncs->destroy.name) \
- ufuncs->destroy.name (ufuncs->user_data.name); \
- \
- if (func) { \
- ufuncs->get.name = func; \
- ufuncs->user_data.name = user_data; \
- ufuncs->destroy.name = destroy; \
- } else if (ufuncs->parent != NULL) { \
- ufuncs->get.name = ufuncs->parent->get.name; \
- ufuncs->user_data.name = ufuncs->parent->user_data.name; \
- ufuncs->destroy.name = NULL; \
- } else { \
- ufuncs->get.name = hb_unicode_get_##name##_nil; \
- ufuncs->user_data.name = NULL; \
- ufuncs->destroy.name = NULL; \
- } \
-} \
- \
-return_type \
-hb_unicode_get_##name (hb_unicode_funcs_t *ufuncs, \
- hb_codepoint_t unicode) \
-{ \
- return ufuncs->get.name (ufuncs, unicode, ufuncs->user_data.name); \
-}
-
-IMPLEMENT (unsigned int, combining_class)
-IMPLEMENT (unsigned int, eastasian_width)
-IMPLEMENT (hb_unicode_general_category_t, general_category)
-IMPLEMENT (hb_codepoint_t, mirroring)
-IMPLEMENT (hb_script_t, script)
-
-#undef IMPLEMENT
+ return ufuncs->parent ? ufuncs->parent : &_hb_unicode_funcs_nil;
+}
+
+
+#define HB_UNICODE_FUNC_IMPLEMENT(name) \
+ \
+void \
+hb_unicode_funcs_set_##name##_func (hb_unicode_funcs_t *ufuncs, \
+ hb_unicode_##name##_func_t func, \
+ void *user_data, \
+ hb_destroy_func_t destroy) \
+{ \
+ if (ufuncs->immutable) \
+ return; \
+ \
+ if (ufuncs->destroy.name) \
+ ufuncs->destroy.name (ufuncs->user_data.name); \
+ \
+ if (func) { \
+ ufuncs->func.name = func; \
+ ufuncs->user_data.name = user_data; \
+ ufuncs->destroy.name = destroy; \
+ } else { \
+ ufuncs->func.name = ufuncs->parent->func.name; \
+ ufuncs->user_data.name = ufuncs->parent->user_data.name; \
+ ufuncs->destroy.name = NULL; \
+ } \
+}
+
+ HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS
+#undef HB_UNICODE_FUNC_IMPLEMENT