Note that unpackage does not make any copies. In one increases the reference count.
| 4222 | // Note that unpackage does not make any copies. |
| 4223 | // In one increases the reference count. |
| 4224 | static hb_value_t * presets_unpackage(const hb_value_t *packaged_presets) |
| 4225 | { |
| 4226 | // Do any legacy translations. |
| 4227 | hb_value_t * imported; |
| 4228 | hb_value_t * tmp = hb_value_dup(packaged_presets); |
| 4229 | hb_presets_import(tmp, &imported); |
| 4230 | hb_value_free(&tmp); |
| 4231 | if (imported == NULL) |
| 4232 | { |
| 4233 | // Invalid preset format, return an empty array |
| 4234 | return hb_value_array_init(); |
| 4235 | } |
| 4236 | hb_value_t *presets = hb_dict_get(imported, "PresetList"); |
| 4237 | hb_value_incref(presets); |
| 4238 | hb_value_free(&imported); |
| 4239 | return presets; |
| 4240 | } |
| 4241 | |
| 4242 | static hb_value_t * presets_package(const hb_value_t *presets) |
| 4243 | { |
no test coverage detected