move stuff in common, clang-format, update copyright
This commit is contained in:
+21
-28
@@ -1,51 +1,44 @@
|
||||
#pragma once
|
||||
|
||||
#include <avahi-common/watch.h>
|
||||
#include <avahi-client/publish.h>
|
||||
#include <avahi-common/simple-watch.h>
|
||||
#include <avahi-common/watch.h>
|
||||
#include <string>
|
||||
|
||||
class avahi_publisher
|
||||
{
|
||||
AvahiEntryGroup *entry_group{};
|
||||
char *name{};
|
||||
AvahiEntryGroup * entry_group{};
|
||||
char * name{};
|
||||
std::string type;
|
||||
int port;
|
||||
|
||||
AvahiSimplePoll *avahi_poll{};
|
||||
AvahiClient *avahi_client{};
|
||||
AvahiSimplePoll * avahi_poll{};
|
||||
AvahiClient * avahi_client{};
|
||||
|
||||
void
|
||||
alt_name();
|
||||
void alt_name();
|
||||
|
||||
void
|
||||
create_service(AvahiClient *client);
|
||||
void create_service(AvahiClient * client);
|
||||
|
||||
static void
|
||||
avahi_entry_group_callback(
|
||||
AvahiEntryGroup *g,
|
||||
AvahiEntryGroupState state /**< The new state of the entry group */,
|
||||
void *userdata /* The arbitrary user data pointer originally passed to avahi_entry_group_new()*/);
|
||||
static void avahi_entry_group_callback(
|
||||
AvahiEntryGroup * g,
|
||||
AvahiEntryGroupState state /**< The new state of the entry group */,
|
||||
void * userdata /* The arbitrary user data pointer originally passed to avahi_entry_group_new()*/);
|
||||
|
||||
static void
|
||||
client_callback(AvahiClient *s,
|
||||
AvahiClientState state /**< The new state of the client */,
|
||||
void *userdata /**< The user data that was passed to avahi_client_new() */);
|
||||
static void client_callback(AvahiClient * s,
|
||||
AvahiClientState state /**< The new state of the client */,
|
||||
void * userdata /**< The user data that was passed to avahi_client_new() */);
|
||||
|
||||
public:
|
||||
avahi_publisher(const char *name, std::string type, int port);
|
||||
avahi_publisher(const char * name, std::string type, int port);
|
||||
|
||||
~avahi_publisher();
|
||||
|
||||
AvahiWatch *
|
||||
watch_new(int fd,
|
||||
AvahiWatchEvent event,
|
||||
void (*callback)(AvahiWatch *w, int fd, AvahiWatchEvent event, void *userdata),
|
||||
void *userdata);
|
||||
AvahiWatch * watch_new(int fd,
|
||||
AvahiWatchEvent event,
|
||||
void (*callback)(AvahiWatch * w, int fd, AvahiWatchEvent event, void * userdata),
|
||||
void * userdata);
|
||||
|
||||
void
|
||||
watch_free(AvahiWatch *watch);
|
||||
void watch_free(AvahiWatch * watch);
|
||||
|
||||
bool
|
||||
iterate(int sleep_time = -1);
|
||||
bool iterate(int sleep_time = -1);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user