-static bool _initialized = false;
-
-void __attribute__ ((destructor)) _destroy_configuration(void);
-
-void _destroy_configuration(void)
-{
- if (_parser)
- g_object_unref(_parser);
-
- if (_module_hash) {
- g_hash_table_remove_all(_module_hash);
- g_hash_table_unref(_module_hash);
- }
-
- _initialized = false;
-}
-
-static enum hal_abi_version __convert_abi_version_str_to_enum(const char *abi_version) {
- int version;
- for (version = HAL_ABI_VERSION_UNKNOWN + 1; version < HAL_ABI_VERSION_END; version++){
- if (g_strcmp0(abi_version, hal_abi_version_str[version]) == 0)
- return (enum hal_abi_version)version;
- }
-
- return HAL_ABI_VERSION_UNKNOWN;
-}
-
-static const char *__convert_module_to_string(enum hal_module module)
-{
- return hal_module_string[module];
-}
-
-static enum hal_group __convert_group_str_to_enum(const char * group)
-{
- enum hal_group group_idx;
-
- for (group_idx = HAL_GROUP_UNKNOWN + 1; group_idx < HAL_GROUP_END; group_idx++) {
- if (g_strcmp0(group, hal_group_string[group_idx]) == 0)
- return group_idx;
- }
-
- return HAL_GROUP_UNKNOWN;
-}
-
-static enum hal_license __convert_license_str_to_enum(const char *license)
-{
- if (g_strcmp0(license, "APACHE_2_0") == 0)
- return HAL_LICENSE_APACHE_2_0;
-
- if (g_strcmp0(license, "FLORA") == 0)
- return HAL_LICENSE_FLORA;
-
- if (g_strcmp0(license, "MIT") == 0)
- return HAL_LICENSE_MIT;
-
- return HAL_LICENSE_UNKNOWN;
-}