diff options
author | Lennart Poettering <lennart@poettering.net> | 2005-05-20 14:54:00 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2005-05-20 14:54:00 +0000 |
commit | 4de3df3db7df43474176533d0b5fac851dd4a9b4 (patch) | |
tree | d7116511e663e1f2f5add289364e0345fc4845e7 /avahi-core/util.c | |
parent | c565e9ad208e8c9aeaf94b02c56597a991b1597f (diff) |
Add support for server state change callbacks
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@78 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-core/util.c')
-rw-r--r-- | avahi-core/util.c | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/avahi-core/util.c b/avahi-core/util.c index fa5eb71..91403e6 100644 --- a/avahi-core/util.c +++ b/avahi-core/util.c @@ -404,54 +404,3 @@ gint avahi_domain_hash(const gchar *s) { } } - -gchar * avahi_alternative_host_name(const gchar *s) { - const gchar *p, *e = NULL; - gchar *c, *r; - gint n; - - g_assert(s); - - for (p = s; *p; p++) - if (!isdigit(*p)) - e = p+1; - - if (e && *e) - n = atoi(e)+1; - else - n = 2; - - c = e ? g_strndup(s, e-s) : g_strdup(s); - r = g_strdup_printf("%s%i", c, n); - g_free(c); - - return r; - -} - -gchar *avahi_alternative_service_name(const gchar *s) { - const gchar *e; - g_assert(s); - - if ((e = strstr(s, " #"))) { - const gchar *n, *p; - e += 2; - - while ((n = strstr(e, " #"))) - e = n + 2; - - for (p = e; *p; p++) - if (!isdigit(*p)) { - e = NULL; - break; - } - } - - if (e) { - gchar *r, *c = g_strndup(s, e-s); - r = g_strdup_printf("%s%i", c, atoi(e)+1); - g_free(c); - return r; - } else - return g_strdup_printf("%s #2", s); -} |