summaryrefslogtreecommitdiffstats
path: root/avahi-daemon/static-services.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2005-08-03 21:07:02 +0000
committerLennart Poettering <lennart@poettering.net>2005-08-03 21:07:02 +0000
commit3a625af272ee8c6f878ba4d44ed1c741a1582395 (patch)
treeee5fb1f6bff53c670cede2882bbe69d408777894 /avahi-daemon/static-services.c
parent69ea921fa92b0b23faf0a955628e3afab5117534 (diff)
* add C examples
* change doxygen to output stuff in "doxygen/" instead of "doxygen-doc/" * implement avahi_entry_group_{reset,is_empty}() and make everyone use it * move holdoff (SLEEPING) time checking from server to entry group * add preliminary error codes git-svn-id: file:///home/lennart/svn/public/avahi/trunk@216 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-daemon/static-services.c')
-rw-r--r--avahi-daemon/static-services.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/avahi-daemon/static-services.c b/avahi-daemon/static-services.c
index 1f9b765..8c54eab 100644
--- a/avahi-daemon/static-services.c
+++ b/avahi-daemon/static-services.c
@@ -152,7 +152,8 @@ static void static_service_free(StaticService *s) {
static void static_service_group_free(StaticServiceGroup *g) {
g_assert(g);
- remove_static_service_group_from_server(g);
+ if (g->entry_group)
+ avahi_entry_group_free(g->entry_group);
while (g->services)
static_service_free(g->services);
@@ -202,8 +203,11 @@ static void add_static_service_group_to_server(StaticServiceGroup *g) {
g->chosen_name = replacestr(g->name, "%h", avahi_server_get_host_name(avahi_server));
else
g->chosen_name = g_strdup(g->name);
-
- g->entry_group = avahi_entry_group_new(avahi_server, entry_group_callback, g);
+
+ if (!g->entry_group)
+ g->entry_group = avahi_entry_group_new(avahi_server, entry_group_callback, g);
+
+ g_assert(avahi_entry_group_is_empty(g->entry_group));
for (s = g->services; s; s = s->services_next) {
@@ -226,10 +230,8 @@ static void add_static_service_group_to_server(StaticServiceGroup *g) {
static void remove_static_service_group_from_server(StaticServiceGroup *g) {
g_assert(g);
- if (g->entry_group) {
- avahi_entry_group_free(g->entry_group);
- g->entry_group = NULL;
- }
+ if (g->entry_group)
+ avahi_entry_group_reset(g->entry_group);
}
typedef enum {