core: add nm_utils_ascii_str_to_bool()

This is effectively the same as nm_config_parse_boolean(). The difference is,
that "nm-config.c" is not available to the interface-helper, thus any
code used by interface-helper (like "NetworkManager.c") cannot use this
function.

Still don't drop nm_config_parse_boolean() entirely, because it's better
to have the explicit notion of parsing a string in the config-context.

I ended up not using the function. But I'd still keep this patch.
This commit is contained in:
Thomas Haller
2015-10-01 13:01:39 +02:00
parent ced1dcabef
commit 72ff5e8cac
3 changed files with 40 additions and 26 deletions

View File

@@ -114,6 +114,11 @@ gboolean nm_utils_error_is_cancelled (GError *error,
/*****************************************************************************/
gint nm_utils_ascii_str_to_bool (const char *str,
gint default_value);
/*****************************************************************************/
gboolean nm_ethernet_address_is_valid (gconstpointer addr, gssize len);
in_addr_t nm_utils_ip4_address_clear_host_address (in_addr_t addr, guint8 plen);