mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-05 00:40:32 +01:00
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:
parent
d2b9f37455
commit
16aeac5c3e
3 changed files with 21 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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__ */
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue