diff options
author | Thomas Haller <thaller@redhat.com> | 2015-10-27 10:25:22 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2015-11-02 13:57:01 +0100 |
commit | 9369fac8ca18f47541526068e83b652646153c18 (patch) | |
tree | a934469afdd2d9bbe2f33b14b77605512c89f70f /src/NetworkManagerUtils.h | |
parent | 99f9785345d3c65509da033c1f7c0d6a14a85e6b (diff) | |
download | NetworkManager-9369fac8ca18f47541526068e83b652646153c18.tar.gz |
core: add nm_utils_to_string_buffer global buffer
Having a static string buffer for convenience is useful not only
for platform. Define the string buffer in NetworkManagerUtils.h,
so that all to-string functions can reuse *one* buffer.
Of course, this has the potential danger, that different
to-string method might reuse the same buffer. Hence, low-level
library functions are adviced to use their own buffer, because
an upper level might already use the global buffer for another
string.
Diffstat (limited to 'src/NetworkManagerUtils.h')
-rw-r--r-- | src/NetworkManagerUtils.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/NetworkManagerUtils.h b/src/NetworkManagerUtils.h index bf90e741cd..b4cc180013 100644 --- a/src/NetworkManagerUtils.h +++ b/src/NetworkManagerUtils.h @@ -191,6 +191,11 @@ NMMatchSpecMatchType nm_match_spec_match_config (const GSList *specs, guint nm_v GSList *nm_match_spec_split (const char *value); char *nm_match_spec_join (GSList *specs); +extern char _nm_utils_to_string_buffer[2096]; + +void nm_utils_to_string_buffer_init (char **buf, gsize *len); +gboolean nm_utils_to_string_buffer_init_null (gconstpointer obj, char **buf, gsize *len); + const char *nm_utils_get_shared_wifi_permission (NMConnection *connection); const char *nm_utils_get_ip_config_method (NMConnection *connection, |