s/AVAHI_LOOKUP_CALLBACK/AVAHI_LOOKUP_RESULT/g
authorLennart Poettering <lennart@poettering.net>
Sun, 25 Sep 2005 22:23:32 +0000 (22:23 +0000)
committerLennart Poettering <lennart@poettering.net>
Sun, 25 Sep 2005 22:23:32 +0000 (22:23 +0000)
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@622 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

avahi-common/defs.h
avahi-core/browse.c
avahi-core/multicast-lookup.c
avahi-core/querier-test.c
avahi-core/wide-area.c
examples/client-browse-services.c
examples/core-browse-services.c

index 6578e2c..a0fb034 100644 (file)
@@ -163,10 +163,10 @@ typedef enum {
 
 /** Some flags for lookup callback functions */
 typedef enum {
-    AVAHI_LOOKUP_CALLBACK_NULL = 0,
-    AVAHI_LOOKUP_CALLBACK_CACHED = 1,      /**< This response originates from the cache */
-    AVAHI_LOOKUP_CALLBACK_WIDE_AREA = 2,   /**< This response originates from wide area DNS */
-    AVAHI_LOOKUP_CALLBACK_MULTICAST = 4,   /**< This response originates from multicast DNS */
+    AVAHI_LOOKUP_RESULT_NULL = 0,
+    AVAHI_LOOKUP_RESULT_CACHED = 1,      /**< This response originates from the cache */
+    AVAHI_LOOKUP_RESULT_WIDE_AREA = 2,   /**< This response originates from wide area DNS */
+    AVAHI_LOOKUP_RESULT_MULTICAST = 4,   /**< This response originates from multicast DNS */
 } AvahiLookupResultFlags;
 
 /** Type of callback event when browsing */
index a6ba7ca..e8494ae 100644 (file)
@@ -466,7 +466,7 @@ static void defer_callback(AvahiTimeEvent *e, void *userdata) {
 
         b->callback(
             b, b->interface, b->protocol, AVAHI_BROWSER_FAILURE, NULL,
-            b->flags & AVAHI_LOOKUP_USE_WIDE_AREA ? AVAHI_LOOKUP_CALLBACK_WIDE_AREA : AVAHI_LOOKUP_CALLBACK_MULTICAST,
+            b->flags & AVAHI_LOOKUP_USE_WIDE_AREA ? AVAHI_LOOKUP_RESULT_WIDE_AREA : AVAHI_LOOKUP_RESULT_MULTICAST,
             b->userdata);
         
         avahi_s_record_browser_cancel(b);
@@ -476,7 +476,7 @@ static void defer_callback(AvahiTimeEvent *e, void *userdata) {
     /* Tell the client that we're done with the cache */
     b->callback(
         b, b->interface, b->protocol, AVAHI_BROWSER_CACHE_EXHAUSTED, NULL,
-        b->flags & AVAHI_LOOKUP_USE_WIDE_AREA ? AVAHI_LOOKUP_CALLBACK_WIDE_AREA : AVAHI_LOOKUP_CALLBACK_MULTICAST,
+        b->flags & AVAHI_LOOKUP_USE_WIDE_AREA ? AVAHI_LOOKUP_RESULT_WIDE_AREA : AVAHI_LOOKUP_RESULT_MULTICAST,
         b->userdata);
 
     if (!b->dead && b->root_lookup && b->root_lookup->flags & AVAHI_LOOKUP_USE_WIDE_AREA && n > 0) {
@@ -485,7 +485,7 @@ static void defer_callback(AvahiTimeEvent *e, void *userdata) {
          * entries, we assume that it is complete, and tell the user
          * so by firing ALL_FOR_NOW. */
         
-        b->callback(b, b->interface, b->protocol, AVAHI_BROWSER_ALL_FOR_NOW, NULL, AVAHI_LOOKUP_CALLBACK_WIDE_AREA, b->userdata);
+        b->callback(b, b->interface, b->protocol, AVAHI_BROWSER_ALL_FOR_NOW, NULL, AVAHI_LOOKUP_RESULT_WIDE_AREA, b->userdata);
     }
 }
 
index 4f04ab8..641ee4d 100644 (file)
@@ -71,7 +71,7 @@ static void all_for_now_callback(AvahiTimeEvent *e, void* userdata) {
     avahi_time_event_free(l->all_for_now_event);
     l->all_for_now_event = NULL;
 
-    l->callback(l->engine, l->interface, l->protocol, AVAHI_BROWSER_ALL_FOR_NOW, AVAHI_LOOKUP_CALLBACK_MULTICAST, NULL, l->userdata);
+    l->callback(l->engine, l->interface, l->protocol, AVAHI_BROWSER_ALL_FOR_NOW, AVAHI_LOOKUP_RESULT_MULTICAST, NULL, l->userdata);
 }
 
 AvahiMulticastLookup *avahi_multicast_lookup_new(
@@ -208,7 +208,7 @@ static void* scan_cache_callback(AvahiCache *c, AvahiKey *pattern, AvahiCacheEnt
         cbdata->interface->hardware->index,
         cbdata->interface->protocol,
         AVAHI_BROWSER_NEW,
-        AVAHI_LOOKUP_CALLBACK_CACHED|AVAHI_LOOKUP_CALLBACK_MULTICAST,
+        AVAHI_LOOKUP_RESULT_CACHED|AVAHI_LOOKUP_RESULT_MULTICAST,
         e->record,
         cbdata->userdata);
 
@@ -295,7 +295,7 @@ void avahi_multicast_lookup_engine_notify(AvahiMulticastLookupEngine *e, AvahiIn
             continue;
 
         if (avahi_interface_match(i, l->interface, l->protocol))
-            l->callback(e, i->hardware->index, i->protocol, event, AVAHI_LOOKUP_CALLBACK_MULTICAST, record, l->userdata);
+            l->callback(e, i->hardware->index, i->protocol, event, AVAHI_LOOKUP_RESULT_MULTICAST, record, l->userdata);
     }
 
 
@@ -310,7 +310,7 @@ void avahi_multicast_lookup_engine_notify(AvahiMulticastLookupEngine *e, AvahiIn
             
             if ((key = avahi_key_new_cname(l->key))) {
                 if (avahi_key_equal(record->key, key))
-                    l->callback(e, i->hardware->index, i->protocol, event, AVAHI_LOOKUP_CALLBACK_MULTICAST, record, l->userdata);
+                    l->callback(e, i->hardware->index, i->protocol, event, AVAHI_LOOKUP_RESULT_MULTICAST, record, l->userdata);
 
                 avahi_key_unref(key);
             }
index f410e66..254ecbb 100644 (file)
@@ -65,7 +65,7 @@ static void sb_callback(
     const char *domain,
     AvahiLookupResultFlags flags,
     void* userdata) {
-    avahi_log_debug("SB%i: (%i.%s) <%s> as <%s> in <%s> [%s] cached=%i", b == service_browser1 ? 1 : 2, iface, avahi_proto_to_string(protocol), name, service_type, domain, browser_event_to_string(event), !!(flags & AVAHI_LOOKUP_CALLBACK_CACHED));
+    avahi_log_debug("SB%i: (%i.%s) <%s> as <%s> in <%s> [%s] cached=%i", b == service_browser1 ? 1 : 2, iface, avahi_proto_to_string(protocol), name, service_type, domain, browser_event_to_string(event), !!(flags & AVAHI_LOOKUP_RESULT_CACHED));
 }
 
 static void create_second_service_browser(AvahiTimeout *timeout, void* userdata) {
index 2f8661d..a66a682 100644 (file)
@@ -173,7 +173,7 @@ static void sender_timeout_callback(AvahiTimeEvent *e, void *userdata) {
     
     if (l->n_send >= 6) {
         avahi_log_warn(__FILE__": Query timed out.");
-        l->callback(l->engine, AVAHI_BROWSER_FAILURE, AVAHI_LOOKUP_CALLBACK_WIDE_AREA, NULL, l->userdata);
+        l->callback(l->engine, AVAHI_BROWSER_FAILURE, AVAHI_LOOKUP_RESULT_WIDE_AREA, NULL, l->userdata);
         avahi_wide_area_lookup_free(l);
         return;
     }
@@ -372,7 +372,7 @@ static void run_callbacks(AvahiWideAreaLookupEngine *e, AvahiRecord *r) {
         if (l->dead || !l->callback)
             continue;
         
-        l->callback(e, AVAHI_BROWSER_NEW, AVAHI_LOOKUP_CALLBACK_WIDE_AREA, r, l->userdata);
+        l->callback(e, AVAHI_BROWSER_NEW, AVAHI_LOOKUP_RESULT_WIDE_AREA, r, l->userdata);
     }
     
     if (r->key->clazz == AVAHI_DNS_CLASS_IN && r->key->type == AVAHI_DNS_TYPE_CNAME) {
@@ -386,7 +386,7 @@ static void run_callbacks(AvahiWideAreaLookupEngine *e, AvahiRecord *r) {
             
             if ((key = avahi_key_new_cname(l->key))) {
                 if (avahi_key_equal(r->key, key))
-                    l->callback(e, AVAHI_BROWSER_NEW, AVAHI_LOOKUP_CALLBACK_WIDE_AREA, r, l->userdata);
+                    l->callback(e, AVAHI_BROWSER_NEW, AVAHI_LOOKUP_RESULT_WIDE_AREA, r, l->userdata);
 
                 avahi_key_unref(key);
             }
@@ -472,7 +472,7 @@ static void handle_packet(AvahiWideAreaLookupEngine *e, AvahiDnsPacket *p, Avahi
 
         /* Tell the user about the failure */
         if (l->callback)
-            l->callback(e, r == 3 ? AVAHI_BROWSER_NOT_FOUND : AVAHI_BROWSER_FAILURE, AVAHI_LOOKUP_CALLBACK_WIDE_AREA, NULL, l->userdata);
+            l->callback(e, r == 3 ? AVAHI_BROWSER_NOT_FOUND : AVAHI_BROWSER_FAILURE, AVAHI_LOOKUP_RESULT_WIDE_AREA, NULL, l->userdata);
         goto finish;
     }
 
@@ -506,7 +506,7 @@ static void handle_packet(AvahiWideAreaLookupEngine *e, AvahiDnsPacket *p, Avahi
 
     /** Inform the user that this is the last reply */
     if (l->callback && !l->dead)
-        l->callback(e, AVAHI_BROWSER_ALL_FOR_NOW, AVAHI_LOOKUP_CALLBACK_WIDE_AREA, NULL, l->userdata);
+        l->callback(e, AVAHI_BROWSER_ALL_FOR_NOW, AVAHI_LOOKUP_RESULT_WIDE_AREA, NULL, l->userdata);
     
 finish:
     if (l)
@@ -666,14 +666,14 @@ unsigned avahi_wide_area_scan_cache(AvahiWideAreaLookupEngine *e, AvahiKey *key,
     assert(callback);
 
     for (c = avahi_hashmap_lookup(e->cache_by_key, key); c; c = c->by_key_next) {
-        callback(e, AVAHI_BROWSER_NEW, AVAHI_LOOKUP_CALLBACK_WIDE_AREA|AVAHI_LOOKUP_CALLBACK_CACHED, c->record, userdata);
+        callback(e, AVAHI_BROWSER_NEW, AVAHI_LOOKUP_RESULT_WIDE_AREA|AVAHI_LOOKUP_RESULT_CACHED, c->record, userdata);
         n++;
     }
 
     if ((cname_key = avahi_key_new_cname(key))) {
 
         for (c = avahi_hashmap_lookup(e->cache_by_key, cname_key); c; c = c->by_key_next) {
-            callback(e, AVAHI_BROWSER_NEW, AVAHI_LOOKUP_CALLBACK_WIDE_AREA|AVAHI_LOOKUP_CALLBACK_CACHED, c->record, userdata);
+            callback(e, AVAHI_BROWSER_NEW, AVAHI_LOOKUP_RESULT_WIDE_AREA|AVAHI_LOOKUP_RESULT_CACHED, c->record, userdata);
             n++;
         }
         
index d03fa31..b4e3411 100644 (file)
@@ -81,9 +81,9 @@ static void resolve_callback(
                     t,
                     avahi_string_list_get_service_cookie(txt),
                     avahi_client_is_service_local(avahi_service_resolver_get_client(r), interface, protocol, name, type, domain),
-                    !!(flags & AVAHI_LOOKUP_CALLBACK_WIDE_AREA),
-                    !!(flags & AVAHI_LOOKUP_CALLBACK_MULTICAST),
-                    !!(flags & AVAHI_LOOKUP_CALLBACK_CACHED));
+                    !!(flags & AVAHI_LOOKUP_RESULT_WIDE_AREA),
+                    !!(flags & AVAHI_LOOKUP_RESULT_MULTICAST),
+                    !!(flags & AVAHI_LOOKUP_RESULT_CACHED));
                 
             avahi_free(t);
         }
index 86b18a0..50f82bc 100644 (file)
@@ -93,9 +93,9 @@ static void resolve_callback(
                     t,
                     avahi_string_list_get_service_cookie(txt),
                     avahi_server_is_service_local(server, interface, protocol, name, type, domain),
-                    !!(flags & AVAHI_LOOKUP_CALLBACK_WIDE_AREA),
-                    !!(flags & AVAHI_LOOKUP_CALLBACK_MULTICAST),
-                    !!(flags & AVAHI_LOOKUP_CALLBACK_CACHED));
+                    !!(flags & AVAHI_LOOKUP_RESULT_WIDE_AREA),
+                    !!(flags & AVAHI_LOOKUP_RESULT_MULTICAST),
+                    !!(flags & AVAHI_LOOKUP_RESULT_CACHED));
             avahi_free(t);
         }
     }