2 * Copyright © 2012 Google, Inc.
4 * This is part of HarfBuzz, a text shaping library.
6 * Permission is hereby granted, without written agreement and without
7 * license or royalty fees, to use, copy, modify, and distribute this
8 * software and its documentation for any purpose, provided that the
9 * above copyright notice and the following two paragraphs appear in
10 * all copies of this software.
12 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
13 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
14 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
15 * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
18 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
19 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
21 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
22 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
24 * Google Author(s): Behdad Esfahbod
27 #if !defined(HB_H_IN) && !defined(HB_NO_SINGLE_HEADER_ERROR)
28 #error "Include <hb.h> instead."
34 #include "hb-common.h"
40 * HB_SET_VALUE_INVALID:
42 * Unset #hb_set_t value.
46 #define HB_SET_VALUE_INVALID HB_CODEPOINT_INVALID
51 * Data type for holding a set of integers. #hb_set_t's are
52 * used to gather and contain glyph IDs, Unicode code
53 * points, and various other collections of discrete
57 typedef struct hb_set_t hb_set_t;
64 hb_set_get_empty (void);
67 hb_set_reference (hb_set_t *set);
70 hb_set_destroy (hb_set_t *set);
73 hb_set_set_user_data (hb_set_t *set,
74 hb_user_data_key_t *key,
76 hb_destroy_func_t destroy,
80 hb_set_get_user_data (const hb_set_t *set,
81 hb_user_data_key_t *key);
84 /* Returns false if allocation has failed before */
86 hb_set_allocation_successful (const hb_set_t *set);
89 hb_set_copy (const hb_set_t *set);
92 hb_set_clear (hb_set_t *set);
95 hb_set_is_empty (const hb_set_t *set);
98 hb_set_invert (hb_set_t *set);
101 hb_set_is_inverted (const hb_set_t *set);
104 hb_set_has (const hb_set_t *set,
105 hb_codepoint_t codepoint);
108 hb_set_add (hb_set_t *set,
109 hb_codepoint_t codepoint);
112 hb_set_add_range (hb_set_t *set,
113 hb_codepoint_t first,
114 hb_codepoint_t last);
117 hb_set_add_sorted_array (hb_set_t *set,
118 const hb_codepoint_t *sorted_codepoints,
119 unsigned int num_codepoints);
122 hb_set_del (hb_set_t *set,
123 hb_codepoint_t codepoint);
126 hb_set_del_range (hb_set_t *set,
127 hb_codepoint_t first,
128 hb_codepoint_t last);
131 hb_set_is_equal (const hb_set_t *set,
132 const hb_set_t *other);
134 HB_EXTERN unsigned int
135 hb_set_hash (const hb_set_t *set);
138 hb_set_is_subset (const hb_set_t *set,
139 const hb_set_t *larger_set);
142 hb_set_set (hb_set_t *set,
143 const hb_set_t *other);
146 hb_set_union (hb_set_t *set,
147 const hb_set_t *other);
150 hb_set_intersect (hb_set_t *set,
151 const hb_set_t *other);
154 hb_set_subtract (hb_set_t *set,
155 const hb_set_t *other);
158 hb_set_symmetric_difference (hb_set_t *set,
159 const hb_set_t *other);
161 HB_EXTERN unsigned int
162 hb_set_get_population (const hb_set_t *set);
164 /* Returns HB_SET_VALUE_INVALID if set empty. */
165 HB_EXTERN hb_codepoint_t
166 hb_set_get_min (const hb_set_t *set);
168 /* Returns HB_SET_VALUE_INVALID if set empty. */
169 HB_EXTERN hb_codepoint_t
170 hb_set_get_max (const hb_set_t *set);
172 /* Pass HB_SET_VALUE_INVALID in to get started. */
174 hb_set_next (const hb_set_t *set,
175 hb_codepoint_t *codepoint);
177 /* Pass HB_SET_VALUE_INVALID in to get started. */
179 hb_set_previous (const hb_set_t *set,
180 hb_codepoint_t *codepoint);
182 /* Pass HB_SET_VALUE_INVALID for first and last to get started. */
184 hb_set_next_range (const hb_set_t *set,
185 hb_codepoint_t *first,
186 hb_codepoint_t *last);
188 /* Pass HB_SET_VALUE_INVALID for first and last to get started. */
190 hb_set_previous_range (const hb_set_t *set,
191 hb_codepoint_t *first,
192 hb_codepoint_t *last);
194 /* Pass HB_SET_VALUE_INVALID in to get started. */
195 HB_EXTERN unsigned int
196 hb_set_next_many (const hb_set_t *set,
197 hb_codepoint_t codepoint,
203 #endif /* HB_SET_H */