1 
2 //          Copyright Ahmet Sait Koçak 2020.
3 // Distributed under the Boost Software License, Version 1.0.
4 //    (See accompanying file LICENSE_1_0.txt or copy at
5 //          https://www.boost.org/LICENSE_1_0.txt)
6 
7 module bindbc.hb.bind.map;
8 
9 import bindbc.hb.config;
10 
11 import bindbc.hb.bind.common;
12 
13 extern(C) @nogc nothrow:
14 
15 static if (hbSupport >= 10707)
16 {
17 	/*
18 	 * Since: 1.7.7
19 	 */
20 	enum HB_MAP_VALUE_INVALID = cast(hb_codepoint_t) -1;
21 
22 	struct hb_map_t;
23 
24 	version(BindHB_Static)
25 		hb_map_t* hb_map_create ();
26 	else
27 	{
28 		private alias fp_hb_map_create = hb_map_t* function ();
29 		__gshared fp_hb_map_create hb_map_create;
30 	}
31 
32 	version(BindHB_Static)
33 		hb_map_t* hb_map_get_empty ();
34 	else
35 	{
36 		private alias fp_hb_map_get_empty = hb_map_t* function ();
37 		__gshared fp_hb_map_get_empty hb_map_get_empty;
38 	}
39 
40 	version(BindHB_Static)
41 		hb_map_t* hb_map_reference (hb_map_t* map);
42 	else
43 	{
44 		private alias fp_hb_map_reference = hb_map_t* function (hb_map_t* map);
45 		__gshared fp_hb_map_reference hb_map_reference;
46 	}
47 
48 	version(BindHB_Static)
49 		void hb_map_destroy (hb_map_t* map);
50 	else
51 	{
52 		private alias fp_hb_map_destroy = void function (hb_map_t* map);
53 		__gshared fp_hb_map_destroy hb_map_destroy;
54 	}
55 
56 	version(BindHB_Static)
57 		hb_bool_t hb_map_set_user_data (
58 			hb_map_t* map,
59 			hb_user_data_key_t* key,
60 			void* data,
61 			hb_destroy_func_t destroy,
62 			hb_bool_t replace);
63 	else
64 	{
65 		private alias fp_hb_map_set_user_data = hb_bool_t function (
66 			hb_map_t* map,
67 			hb_user_data_key_t* key,
68 			void* data,
69 			hb_destroy_func_t destroy,
70 			hb_bool_t replace);
71 		__gshared fp_hb_map_set_user_data hb_map_set_user_data;
72 	}
73 
74 	version(BindHB_Static)
75 		void* hb_map_get_user_data (hb_map_t* map, hb_user_data_key_t* key);
76 	else
77 	{
78 		private alias fp_hb_map_get_user_data = void* function (hb_map_t* map, hb_user_data_key_t* key);
79 		__gshared fp_hb_map_get_user_data hb_map_get_user_data;
80 	}
81 
82 	/* Returns false if allocation has failed before */
83 	version(BindHB_Static)
84 		hb_bool_t hb_map_allocation_successful (const(hb_map_t)* map);
85 	else
86 	{
87 		private alias fp_hb_map_allocation_successful = hb_bool_t function (const(hb_map_t)* map);
88 		__gshared fp_hb_map_allocation_successful hb_map_allocation_successful;
89 	}
90 
91 	version(BindHB_Static)
92 		void hb_map_clear (hb_map_t* map);
93 	else
94 	{
95 		private alias fp_hb_map_clear = void function (hb_map_t* map);
96 		__gshared fp_hb_map_clear hb_map_clear;
97 	}
98 
99 	version(BindHB_Static)
100 		hb_bool_t hb_map_is_empty (const(hb_map_t)* map);
101 	else
102 	{
103 		private alias fp_hb_map_is_empty = hb_bool_t function (const(hb_map_t)* map);
104 		__gshared fp_hb_map_is_empty hb_map_is_empty;
105 	}
106 
107 	version(BindHB_Static)
108 		uint hb_map_get_population (const(hb_map_t)* map);
109 	else
110 	{
111 		private alias fp_hb_map_get_population = uint function (const(hb_map_t)* map);
112 		__gshared fp_hb_map_get_population hb_map_get_population;
113 	}
114 
115 	version(BindHB_Static)
116 		void hb_map_set (hb_map_t* map, hb_codepoint_t key, hb_codepoint_t value);
117 	else
118 	{
119 		private alias fp_hb_map_set = void function (hb_map_t* map, hb_codepoint_t key, hb_codepoint_t value);
120 		__gshared fp_hb_map_set hb_map_set;
121 	}
122 
123 	version(BindHB_Static)
124 		hb_codepoint_t hb_map_get (const(hb_map_t)* map, hb_codepoint_t key);
125 	else
126 	{
127 		private alias fp_hb_map_get = hb_codepoint_t function (const(hb_map_t)* map, hb_codepoint_t key);
128 		__gshared fp_hb_map_get hb_map_get;
129 	}
130 
131 	version(BindHB_Static)
132 		void hb_map_del (hb_map_t* map, hb_codepoint_t key);
133 	else
134 	{
135 		private alias fp_hb_map_del = void function (hb_map_t* map, hb_codepoint_t key);
136 		__gshared fp_hb_map_del hb_map_del;
137 	}
138 
139 	version(BindHB_Static)
140 		hb_bool_t hb_map_has (const(hb_map_t)* map, hb_codepoint_t key);
141 	else
142 	{
143 		private alias fp_hb_map_has = hb_bool_t function (const(hb_map_t)* map, hb_codepoint_t key);
144 		__gshared fp_hb_map_has hb_map_has;
145 	}
146 }