]> git.meshlink.io Git - catta/commitdiff
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 6578e2cc8670876389c9c3309a20189b4d06bc2d..a0fb034eca9b0b69b16ea3342d6c0509831c7eda 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 a6ba7cabf0a698f0d8c22054d578aa7257ed1e6c..e8494ae80be978ba999c96ba9cd1db9809b7aed3 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 4f04ab86b98515df122166457eccfba756533ff9..641ee4da939a9d8af49a7f3e7efa9e4079230617 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 f410e66de7be02aba98852c9fc52a3a4d9f07eb0..254ecbb49054c5e1b42c70a00136ad278eae43cc 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 2f8661d24c4c3a0c5d2e7284995a95c0895c9b7d..a66a68243fa11ed5eff6a33470b1ed511c5a01b2 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 d03fa31a76dd152f502cd7a2cd467421ed0a5900..b4e34115f74e50f659cbd59d2aaf7ce68e5f807d 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 86b18a007aef8172b30899afa5b8181e62112dd0..50f82bc9ee2ba41df2aad385acff93b7928a123d 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);
         }
     }