libnm: add nm_utils_version() function to query libnm version at runtime

if (nm_utils_version () < NM_ENCODE_VERSION (1, 5, 0))
        g_error ("Requires at least version 1.5.0");
This commit is contained in:
Thomas Haller 2016-12-20 16:36:15 +01:00
parent d2b9f37455
commit 16aeac5c3e
3 changed files with 21 additions and 0 deletions

View file

@ -4626,3 +4626,20 @@ _nm_utils_team_config_equal (const char *conf1,
return nm_streq0 (conf1, conf2);
}
#endif
/*****************************************************************************/
/**
* nm_utils_version:
*
* Returns: the version ID of the libnm version. That is, the %NM_VERSION
* at runtime.
*
* Since: 1.6.0
*/
guint
nm_utils_version (void)
{
return NM_VERSION;
}

View file

@ -209,6 +209,9 @@ gboolean nm_utils_enum_from_str (GType type, const char *str, int *out_value, ch
NM_AVAILABLE_IN_1_2
const char **nm_utils_enum_get_values (GType type, gint from, gint to);
NM_AVAILABLE_IN_1_6
guint nm_utils_version (void);
G_END_DECLS
#endif /* __NM_UTILS_H__ */

View file

@ -1107,4 +1107,5 @@ global:
nm_setting_proxy_get_pac_url;
nm_setting_proxy_get_pac_script;
nm_utils_is_json_object;
nm_utils_version;
} libnm_1_4_0;