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 18 matching lines...) Expand all Loading... |
29 #include "hb-private.hh" | 29 #include "hb-private.hh" |
30 | 30 |
31 #include "hb-version.h" | 31 #include "hb-version.h" |
32 | 32 |
33 #include "hb-mutex-private.hh" | 33 #include "hb-mutex-private.hh" |
34 #include "hb-object-private.hh" | 34 #include "hb-object-private.hh" |
35 | 35 |
36 #include <locale.h> | 36 #include <locale.h> |
37 | 37 |
38 | 38 |
| 39 /* hb_options_t */ |
| 40 |
| 41 hb_options_union_t _hb_options; |
| 42 |
| 43 void |
| 44 _hb_options_init (void) |
| 45 { |
| 46 hb_options_union_t u; |
| 47 u.i = 0; |
| 48 u.opts.initialized = 1; |
| 49 |
| 50 char *c = getenv ("HB_OPTIONS"); |
| 51 u.opts.uniscribe_bug_compatible = c && strstr (c, "uniscribe-bug-compatible"); |
| 52 |
| 53 /* This is idempotent and threadsafe. */ |
| 54 _hb_options = u; |
| 55 } |
| 56 |
39 | 57 |
40 /* hb_tag_t */ | 58 /* hb_tag_t */ |
41 | 59 |
42 hb_tag_t | 60 hb_tag_t |
43 hb_tag_from_string (const char *s, int len) | 61 hb_tag_from_string (const char *s, int len) |
44 { | 62 { |
45 char tag[4]; | 63 char tag[4]; |
46 unsigned int i; | 64 unsigned int i; |
47 | 65 |
48 if (!s || !len || !*s) | 66 if (!s || !len || !*s) |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 } | 188 } |
171 | 189 |
172 void finish (void) { free (lang); } | 190 void finish (void) { free (lang); } |
173 }; | 191 }; |
174 | 192 |
175 | 193 |
176 /* Thread-safe lock-free language list */ | 194 /* Thread-safe lock-free language list */ |
177 | 195 |
178 static hb_language_item_t *langs; | 196 static hb_language_item_t *langs; |
179 | 197 |
180 static | 198 static inline |
181 void free_langs (void) | 199 void free_langs (void) |
182 { | 200 { |
183 while (langs) { | 201 while (langs) { |
184 hb_language_item_t *next = langs->next; | 202 hb_language_item_t *next = langs->next; |
185 langs->finish (); | 203 langs->finish (); |
186 free (langs); | 204 free (langs); |
187 langs = next; | 205 langs = next; |
188 } | 206 } |
189 } | 207 } |
190 | 208 |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 return HB_VERSION_STRING; | 425 return HB_VERSION_STRING; |
408 } | 426 } |
409 | 427 |
410 hb_bool_t | 428 hb_bool_t |
411 hb_version_check (unsigned int major, | 429 hb_version_check (unsigned int major, |
412 unsigned int minor, | 430 unsigned int minor, |
413 unsigned int micro) | 431 unsigned int micro) |
414 { | 432 { |
415 return HB_VERSION_CHECK (major, minor, micro); | 433 return HB_VERSION_CHECK (major, minor, micro); |
416 } | 434 } |
417 | |
418 | |
OLD | NEW |