OLD | NEW |
1 /* | 1 /* |
2 * Copyright © 2009,2010 Red Hat, Inc. | 2 * Copyright © 2009,2010 Red Hat, Inc. |
3 * Copyright © 2011,2012 Google, Inc. | 3 * Copyright © 2011,2012 Google, Inc. |
4 * | 4 * |
5 * This is part of HarfBuzz, a text shaping library. | 5 * This is part of HarfBuzz, a text shaping library. |
6 * | 6 * |
7 * Permission is hereby granted, without written agreement and without | 7 * Permission is hereby granted, without written agreement and without |
8 * license or royalty fees, to use, copy, modify, and distribute this | 8 * license or royalty fees, to use, copy, modify, and distribute this |
9 * software and its documentation for any purpose, provided that the | 9 * software and its documentation for any purpose, provided that the |
10 * above copyright notice and the following two paragraphs appear in | 10 * above copyright notice and the following two paragraphs appear in |
(...skipping 10 matching lines...) Expand all Loading... |
21 * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS | 21 * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS |
22 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO | 22 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO |
23 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | 23 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
24 * | 24 * |
25 * Red Hat Author(s): Behdad Esfahbod | 25 * Red Hat Author(s): Behdad Esfahbod |
26 * Google Author(s): Behdad Esfahbod | 26 * Google Author(s): Behdad Esfahbod |
27 */ | 27 */ |
28 | 28 |
29 #include "hb-private.hh" | 29 #include "hb-private.hh" |
30 | 30 |
31 #include "hb-version.h" | |
32 | |
33 #include "hb-mutex-private.hh" | 31 #include "hb-mutex-private.hh" |
34 #include "hb-object-private.hh" | 32 #include "hb-object-private.hh" |
35 | 33 |
36 #include <locale.h> | 34 #include <locale.h> |
37 | 35 |
38 | 36 |
39 /* hb_options_t */ | 37 /* hb_options_t */ |
40 | 38 |
41 hb_options_union_t _hb_options; | 39 hb_options_union_t _hb_options; |
42 | 40 |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 } | 227 } |
230 | 228 |
231 void finish (void) { free ((void *) lang); } | 229 void finish (void) { free ((void *) lang); } |
232 }; | 230 }; |
233 | 231 |
234 | 232 |
235 /* Thread-safe lock-free language list */ | 233 /* Thread-safe lock-free language list */ |
236 | 234 |
237 static hb_language_item_t *langs; | 235 static hb_language_item_t *langs; |
238 | 236 |
| 237 #ifdef HAVE_ATEXIT |
239 static inline | 238 static inline |
240 void free_langs (void) | 239 void free_langs (void) |
241 { | 240 { |
242 while (langs) { | 241 while (langs) { |
243 hb_language_item_t *next = langs->next; | 242 hb_language_item_t *next = langs->next; |
244 langs->finish (); | 243 langs->finish (); |
245 free (langs); | 244 free (langs); |
246 langs = next; | 245 langs = next; |
247 } | 246 } |
248 } | 247 } |
| 248 #endif |
249 | 249 |
250 static hb_language_item_t * | 250 static hb_language_item_t * |
251 lang_find_or_insert (const char *key) | 251 lang_find_or_insert (const char *key) |
252 { | 252 { |
253 retry: | 253 retry: |
254 hb_language_item_t *first_lang = (hb_language_item_t *) hb_atomic_ptr_get (&la
ngs); | 254 hb_language_item_t *first_lang = (hb_language_item_t *) hb_atomic_ptr_get (&la
ngs); |
255 | 255 |
256 for (hb_language_item_t *lang = first_lang; lang; lang = lang->next) | 256 for (hb_language_item_t *lang = first_lang; lang; lang = lang->next) |
257 if (*lang == key) | 257 if (*lang == key) |
258 return lang; | 258 return lang; |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 * | 570 * |
571 * Since: 1.0 | 571 * Since: 1.0 |
572 **/ | 572 **/ |
573 hb_bool_t | 573 hb_bool_t |
574 hb_version_check (unsigned int major, | 574 hb_version_check (unsigned int major, |
575 unsigned int minor, | 575 unsigned int minor, |
576 unsigned int micro) | 576 unsigned int micro) |
577 { | 577 { |
578 return HB_VERSION_CHECK (major, minor, micro); | 578 return HB_VERSION_CHECK (major, minor, micro); |
579 } | 579 } |
OLD | NEW |