Fix compiler warnings with -pedantic
[profile/ivi/org.tizen.video-player.git] / src / hb-unicode-private.hh
1 /*
2  * Copyright © 2009  Red Hat, Inc.
3  * Copyright © 2011  Codethink Limited
4  * Copyright © 2010,2011  Google, Inc.
5  *
6  *  This is part of HarfBuzz, a text shaping library.
7  *
8  * Permission is hereby granted, without written agreement and without
9  * license or royalty fees, to use, copy, modify, and distribute this
10  * software and its documentation for any purpose, provided that the
11  * above copyright notice and the following two paragraphs appear in
12  * all copies of this software.
13  *
14  * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
15  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
16  * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
17  * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
18  * DAMAGE.
19  *
20  * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
21  * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
22  * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
23  * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
24  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
25  *
26  * Red Hat Author(s): Behdad Esfahbod
27  * Codethink Author(s): Ryan Lortie
28  * Google Author(s): Behdad Esfahbod
29  */
30
31 #ifndef HB_UNICODE_PRIVATE_HH
32 #define HB_UNICODE_PRIVATE_HH
33
34 #include "hb-private.hh"
35
36 #include "hb-unicode.h"
37 #include "hb-object-private.hh"
38
39 HB_BEGIN_DECLS
40
41
42 /*
43  * hb_unicode_funcs_t
44  */
45
46 struct _hb_unicode_funcs_t {
47   hb_object_header_t header;
48
49   hb_unicode_funcs_t *parent;
50
51   bool immutable;
52
53 #define IMPLEMENT(return_type, name) \
54   inline return_type \
55   get_##name (hb_codepoint_t unicode) \
56   { return this->get.name (this, unicode, this->user_data.name); }
57
58   IMPLEMENT (unsigned int, combining_class)
59   IMPLEMENT (unsigned int, eastasian_width)
60   IMPLEMENT (hb_unicode_general_category_t, general_category)
61   IMPLEMENT (hb_codepoint_t, mirroring)
62   IMPLEMENT (hb_script_t, script)
63
64 #undef IMPLEMENT
65
66   /* Don't access these directly.  Call get_*() instead. */
67
68   struct {
69     hb_unicode_get_combining_class_func_t       combining_class;
70     hb_unicode_get_eastasian_width_func_t       eastasian_width;
71     hb_unicode_get_general_category_func_t      general_category;
72     hb_unicode_get_mirroring_func_t             mirroring;
73     hb_unicode_get_script_func_t                script;
74   } get;
75
76   struct {
77     void                                        *combining_class;
78     void                                        *eastasian_width;
79     void                                        *general_category;
80     void                                        *mirroring;
81     void                                        *script;
82   } user_data;
83
84   struct {
85     hb_destroy_func_t                           combining_class;
86     hb_destroy_func_t                           eastasian_width;
87     hb_destroy_func_t                           general_category;
88     hb_destroy_func_t                           mirroring;
89     hb_destroy_func_t                           script;
90   } destroy;
91 };
92
93
94 #if HAVE_GLIB
95 extern HB_INTERNAL hb_unicode_funcs_t _hb_glib_unicode_funcs;
96 #define _hb_unicode_funcs_default _hb_glib_unicode_funcs
97 #elif HAVE_ICU
98 extern HB_INTERNAL hb_unicode_funcs_t _hb_icu_unicode_funcs;
99 #define _hb_unicode_funcs_default _hb_icu_unicode_funcs
100 #else
101 extern HB_INTERNAL hb_unicode_funcs_t _hb_unicode_funcs_nil;
102 #define _hb_unicode_funcs_default _hb_unicode_funcs_nil
103 #endif
104
105
106
107 HB_END_DECLS
108
109 #endif /* HB_UNICODE_PRIVATE_HH */