Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-21 10:04:02

0001 /*
0002  * Copyright © 2012  Google, Inc.
0003  *
0004  *  This is part of HarfBuzz, a text shaping library.
0005  *
0006  * Permission is hereby granted, without written agreement and without
0007  * license or royalty fees, to use, copy, modify, and distribute this
0008  * software and its documentation for any purpose, provided that the
0009  * above copyright notice and the following two paragraphs appear in
0010  * all copies of this software.
0011  *
0012  * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
0013  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
0014  * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
0015  * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
0016  * DAMAGE.
0017  *
0018  * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
0019  * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
0020  * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
0021  * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
0022  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
0023  *
0024  * Google Author(s): Behdad Esfahbod
0025  */
0026 
0027 #if !defined(HB_H_IN) && !defined(HB_NO_SINGLE_HEADER_ERROR)
0028 #error "Include <hb.h> instead."
0029 #endif
0030 
0031 #ifndef HB_SET_H
0032 #define HB_SET_H
0033 
0034 #include "hb-common.h"
0035 
0036 HB_BEGIN_DECLS
0037 
0038 
0039 /**
0040  * HB_SET_VALUE_INVALID:
0041  *
0042  * Unset #hb_set_t value.
0043  *
0044  * Since: 0.9.21
0045  */
0046 #define HB_SET_VALUE_INVALID HB_CODEPOINT_INVALID
0047 
0048 /**
0049  * hb_set_t:
0050  *
0051  * Data type for holding a set of integers. #hb_set_t's are
0052  * used to gather and contain glyph IDs, Unicode code
0053  * points, and various other collections of discrete 
0054  * values.
0055  *
0056  **/
0057 typedef struct hb_set_t hb_set_t;
0058 
0059 
0060 HB_EXTERN hb_set_t *
0061 hb_set_create (void);
0062 
0063 HB_EXTERN hb_set_t *
0064 hb_set_get_empty (void);
0065 
0066 HB_EXTERN hb_set_t *
0067 hb_set_reference (hb_set_t *set);
0068 
0069 HB_EXTERN void
0070 hb_set_destroy (hb_set_t *set);
0071 
0072 HB_EXTERN hb_bool_t
0073 hb_set_set_user_data (hb_set_t           *set,
0074               hb_user_data_key_t *key,
0075               void *              data,
0076               hb_destroy_func_t   destroy,
0077               hb_bool_t           replace);
0078 
0079 HB_EXTERN void *
0080 hb_set_get_user_data (const hb_set_t     *set,
0081               hb_user_data_key_t *key);
0082 
0083 
0084 /* Returns false if allocation has failed before */
0085 HB_EXTERN hb_bool_t
0086 hb_set_allocation_successful (const hb_set_t *set);
0087 
0088 HB_EXTERN hb_set_t *
0089 hb_set_copy (const hb_set_t *set);
0090 
0091 HB_EXTERN void
0092 hb_set_clear (hb_set_t *set);
0093 
0094 HB_EXTERN hb_bool_t
0095 hb_set_is_empty (const hb_set_t *set);
0096 
0097 HB_EXTERN void
0098 hb_set_invert (hb_set_t *set);
0099 
0100 HB_EXTERN hb_bool_t
0101 hb_set_is_inverted (const hb_set_t *set);
0102 
0103 HB_EXTERN hb_bool_t
0104 hb_set_has (const hb_set_t *set,
0105         hb_codepoint_t  codepoint);
0106 
0107 HB_EXTERN void
0108 hb_set_add (hb_set_t       *set,
0109         hb_codepoint_t  codepoint);
0110 
0111 HB_EXTERN void
0112 hb_set_add_range (hb_set_t       *set,
0113           hb_codepoint_t  first,
0114           hb_codepoint_t  last);
0115 
0116 HB_EXTERN void
0117 hb_set_add_sorted_array (hb_set_t             *set,
0118                  const hb_codepoint_t *sorted_codepoints,
0119                  unsigned int          num_codepoints);
0120 
0121 HB_EXTERN void
0122 hb_set_del (hb_set_t       *set,
0123         hb_codepoint_t  codepoint);
0124 
0125 HB_EXTERN void
0126 hb_set_del_range (hb_set_t       *set,
0127           hb_codepoint_t  first,
0128           hb_codepoint_t  last);
0129 
0130 HB_EXTERN hb_bool_t
0131 hb_set_is_equal (const hb_set_t *set,
0132          const hb_set_t *other);
0133 
0134 HB_EXTERN unsigned int
0135 hb_set_hash (const hb_set_t *set);
0136 
0137 HB_EXTERN hb_bool_t
0138 hb_set_is_subset (const hb_set_t *set,
0139           const hb_set_t *larger_set);
0140 
0141 HB_EXTERN void
0142 hb_set_set (hb_set_t       *set,
0143         const hb_set_t *other);
0144 
0145 HB_EXTERN void
0146 hb_set_union (hb_set_t       *set,
0147           const hb_set_t *other);
0148 
0149 HB_EXTERN void
0150 hb_set_intersect (hb_set_t       *set,
0151           const hb_set_t *other);
0152 
0153 HB_EXTERN void
0154 hb_set_subtract (hb_set_t       *set,
0155          const hb_set_t *other);
0156 
0157 HB_EXTERN void
0158 hb_set_symmetric_difference (hb_set_t       *set,
0159                  const hb_set_t *other);
0160 
0161 HB_EXTERN unsigned int
0162 hb_set_get_population (const hb_set_t *set);
0163 
0164 /* Returns HB_SET_VALUE_INVALID if set empty. */
0165 HB_EXTERN hb_codepoint_t
0166 hb_set_get_min (const hb_set_t *set);
0167 
0168 /* Returns HB_SET_VALUE_INVALID if set empty. */
0169 HB_EXTERN hb_codepoint_t
0170 hb_set_get_max (const hb_set_t *set);
0171 
0172 /* Pass HB_SET_VALUE_INVALID in to get started. */
0173 HB_EXTERN hb_bool_t
0174 hb_set_next (const hb_set_t *set,
0175          hb_codepoint_t *codepoint);
0176 
0177 /* Pass HB_SET_VALUE_INVALID in to get started. */
0178 HB_EXTERN hb_bool_t
0179 hb_set_previous (const hb_set_t *set,
0180          hb_codepoint_t *codepoint);
0181 
0182 /* Pass HB_SET_VALUE_INVALID for first and last to get started. */
0183 HB_EXTERN hb_bool_t
0184 hb_set_next_range (const hb_set_t *set,
0185            hb_codepoint_t *first,
0186            hb_codepoint_t *last);
0187 
0188 /* Pass HB_SET_VALUE_INVALID for first and last to get started. */
0189 HB_EXTERN hb_bool_t
0190 hb_set_previous_range (const hb_set_t *set,
0191                hb_codepoint_t *first,
0192                hb_codepoint_t *last);
0193 
0194 /* Pass HB_SET_VALUE_INVALID in to get started. */
0195 HB_EXTERN unsigned int
0196 hb_set_next_many (const hb_set_t *set,
0197           hb_codepoint_t  codepoint,
0198           hb_codepoint_t *out,
0199           unsigned int    size);
0200 
0201 HB_END_DECLS
0202 
0203 #endif /* HB_SET_H */