X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-client%2Fclient.h;h=de6f207207bb56af868126ab6154e061921fe17a;hb=519c8939aa6d436c8ed48bb0f390e9971676928f;hp=a242124ee333cfbfed0a10ca366d21006817ce20;hpb=9f0dd75f02f5eceb758436de07f18fcc892c12f0;p=catta diff --git a/avahi-client/client.h b/avahi-client/client.h index a242124..de6f207 100644 --- a/avahi-client/client.h +++ b/avahi-client/client.h @@ -28,6 +28,7 @@ #include #include #include +#include /** \file client.h Definitions and functions for the client API over D-Bus */ @@ -58,16 +59,16 @@ typedef void (*AvahiClientCallback) (AvahiClient *s, AvahiClientState state, voi typedef void (*AvahiEntryGroupCallback) (AvahiEntryGroup *g, AvahiEntryGroupState state, void* userdata); /** The function prototype for the callback of an AvahiDomainBrowser */ -typedef void (*AvahiDomainBrowserCallback) (AvahiDomainBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, char *domain, void *user_data); +typedef void (*AvahiDomainBrowserCallback) (AvahiDomainBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const char *domain, void *user_data); /** The function prototype for the callback of an AvahiServiceBrowser */ -typedef void (*AvahiServiceBrowserCallback) (AvahiServiceBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, char *name, char *type, char *domain, void *user_data); +typedef void (*AvahiServiceBrowserCallback) (AvahiServiceBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const char *name, const char *type, const char *domain, void *user_data); /** The function prototype for the callback of an AvahiServiceTypeBrowser */ -typedef void (*AvahiServiceTypeBrowserCallback) (AvahiServiceTypeBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, char *type, char *domain, void *user_data); +typedef void (*AvahiServiceTypeBrowserCallback) (AvahiServiceTypeBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const char *type, const char *domain, void *user_data); /** Creates a new client instance */ -AvahiClient* avahi_client_new (AvahiClientCallback callback, void *user_data); +AvahiClient* avahi_client_new (const AvahiPoll *poll_api, AvahiClientCallback callback, void *user_data); /** Get the version of the server */ char* avahi_client_get_version_string (AvahiClient*); @@ -84,6 +85,9 @@ char* avahi_client_get_host_name_fqdn (AvahiClient*); /** Create a new AvahiEntryGroup object */ AvahiEntryGroup* avahi_entry_group_new (AvahiClient*, AvahiEntryGroupCallback callback, void *user_data); +/** Clean up and free an AvahiEntryGroup object */ +int avahi_entry_group_free (AvahiEntryGroup *); + /** Commit an AvahiEntryGroup */ int avahi_entry_group_commit (AvahiEntryGroup*); @@ -115,45 +119,54 @@ avahi_entry_group_add_service (AvahiEntryGroup *group, AvahiStringList *txt); /** Get the D-Bus path of an AvahiEntryGroup object, for debugging purposes only. */ -char* avahi_entry_group_path (AvahiEntryGroup *); - -/** Get the D-Bus path of an AvahiDomainBrowser object, for debugging purposes only. */ -char* avahi_domain_browser_path (AvahiDomainBrowser *); +const char* avahi_entry_group_path (AvahiEntryGroup *); /** Browse for domains on the local network */ AvahiDomainBrowser* avahi_domain_browser_new (AvahiClient *client, AvahiIfIndex interface, AvahiProtocol protocol, - char *domain, + const char *domain, AvahiDomainBrowserType btype, AvahiDomainBrowserCallback callback, void *user_data); -/** Get the D-Bus path of an AvahiServiceTypeBrowser object, for debugging purposes only. */ -char* avahi_service_type_browser_path (AvahiServiceTypeBrowser *); +/** Get the D-Bus path of an AvahiDomainBrowser object, for debugging purposes only. */ +const char* avahi_domain_browser_path (AvahiDomainBrowser *); + +/** Cleans up and frees an AvahiDomainBrowser object */ +int avahi_domain_browser_free (AvahiDomainBrowser *); /** Browse for service types on the local network */ AvahiServiceTypeBrowser* avahi_service_type_browser_new ( AvahiClient *client, AvahiIfIndex interface, AvahiProtocol protocol, - char *domain, + const char *domain, AvahiServiceTypeBrowserCallback callback, void *user_data); -/** Get the D-Bus path of an AvahiServiceBrowser object, for debugging purposes only. */ -char* avahi_service_browser_path (AvahiServiceBrowser *); +/** Get the D-Bus path of an AvahiServiceTypeBrowser object, for debugging purposes only. */ +const char* avahi_service_type_browser_path (AvahiServiceTypeBrowser *); + +/** Cleans up and frees an AvahiServiceTypeBrowser object */ +int avahi_service_type_browser_free (AvahiServiceTypeBrowser *); /** Browse for services of a type on the local network */ AvahiServiceBrowser* avahi_service_browser_new ( AvahiClient *client, AvahiIfIndex interface, AvahiProtocol protocol, - char *type, - char *domain, + const char *type, + const char *domain, AvahiServiceBrowserCallback callback, void *user_data); +/** Get the D-Bus path of an AvahiServiceBrowser object, for debugging purposes only. */ +const char* avahi_service_browser_path (AvahiServiceBrowser *); + +/* Cleans up and frees an AvahiServiceBrowser object */ +int avahi_service_browser_free (AvahiServiceBrowser *); + #ifndef DOXYGEN_SHOULD_SKIP_THIS AVAHI_C_DECL_END #endif