From 8185ec8431c51946095d3f11e80545e3519f67cf Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sun, 25 Sep 2005 22:23:32 +0000 Subject: [PATCH] s/AVAHI_LOOKUP_CALLBACK/AVAHI_LOOKUP_RESULT/g git-svn-id: file:///home/lennart/svn/public/avahi/trunk@622 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-common/defs.h | 8 ++++---- avahi-core/browse.c | 6 +++--- avahi-core/multicast-lookup.c | 8 ++++---- avahi-core/querier-test.c | 2 +- avahi-core/wide-area.c | 14 +++++++------- examples/client-browse-services.c | 6 +++--- examples/core-browse-services.c | 6 +++--- 7 files changed, 25 insertions(+), 25 deletions(-) diff --git a/avahi-common/defs.h b/avahi-common/defs.h index 6578e2c..a0fb034 100644 --- a/avahi-common/defs.h +++ b/avahi-common/defs.h @@ -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 */ diff --git a/avahi-core/browse.c b/avahi-core/browse.c index a6ba7ca..e8494ae 100644 --- a/avahi-core/browse.c +++ b/avahi-core/browse.c @@ -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); } } diff --git a/avahi-core/multicast-lookup.c b/avahi-core/multicast-lookup.c index 4f04ab8..641ee4d 100644 --- a/avahi-core/multicast-lookup.c +++ b/avahi-core/multicast-lookup.c @@ -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); } diff --git a/avahi-core/querier-test.c b/avahi-core/querier-test.c index f410e66..254ecbb 100644 --- a/avahi-core/querier-test.c +++ b/avahi-core/querier-test.c @@ -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) { diff --git a/avahi-core/wide-area.c b/avahi-core/wide-area.c index 2f8661d..a66a682 100644 --- a/avahi-core/wide-area.c +++ b/avahi-core/wide-area.c @@ -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++; } diff --git a/examples/client-browse-services.c b/examples/client-browse-services.c index d03fa31..b4e3411 100644 --- a/examples/client-browse-services.c +++ b/examples/client-browse-services.c @@ -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); } diff --git a/examples/core-browse-services.c b/examples/core-browse-services.c index 86b18a0..50f82bc 100644 --- a/examples/core-browse-services.c +++ b/examples/core-browse-services.c @@ -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); } } -- 2.39.5