Commit 4e8bb573 authored by W. Michael Petullo's avatar W. Michael Petullo
Browse files

Change DmapMdnsPub... to DMAPMdnsPub...


Signed-off-by: W. Michael Petullo's avatarW. Michael Petullo <mike@flyn.org>
parent 9f72ed79
......@@ -40,13 +40,13 @@
#include "dmap-mdns-avahi.h"
#include "dmap-mdns-publisher.h"
static void dmap_mdns_publisher_class_init (DmapMdnsPublisherClass *klass);
static void dmap_mdns_publisher_init (DmapMdnsPublisher *publisher);
static void dmap_mdns_publisher_class_init (DMAPMdnsPublisherClass *klass);
static void dmap_mdns_publisher_init (DMAPMdnsPublisher *publisher);
static void dmap_mdns_publisher_finalize (GObject *object);
#define DMAP_MDNS_PUBLISHER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_DMAP_MDNS_PUBLISHER, DmapMdnsPublisherPrivate))
#define DMAP_MDNS_PUBLISHER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_DMAP_MDNS_PUBLISHER, DMAPMdnsPublisherPrivate))
struct DmapMdnsPublisherService
struct DMAPMdnsPublisherService
{
char *name;
guint port;
......@@ -55,7 +55,7 @@ struct DmapMdnsPublisherService
gchar **txt_records;
};
struct DmapMdnsPublisherPrivate
struct DMAPMdnsPublisherPrivate
{
AvahiClient *client;
AvahiEntryGroup *entry_group;
......@@ -74,7 +74,7 @@ enum {
static guint signals [LAST_SIGNAL] = { 0, };
G_DEFINE_TYPE (DmapMdnsPublisher, dmap_mdns_publisher, G_TYPE_OBJECT)
G_DEFINE_TYPE (DMAPMdnsPublisher, dmap_mdns_publisher, G_TYPE_OBJECT)
static gpointer publisher_object = NULL;
......@@ -89,7 +89,7 @@ dmap_mdns_publisher_error_quark (void)
}
static void
emit_published (char *name, DmapMdnsPublisher *publisher)
emit_published (char *name, DMAPMdnsPublisher *publisher)
{
g_signal_emit (publisher, signals [PUBLISHED], 0, name);
}
......@@ -97,7 +97,7 @@ emit_published (char *name, DmapMdnsPublisher *publisher)
static void
entry_group_cb (AvahiEntryGroup *group,
AvahiEntryGroupState state,
DmapMdnsPublisher *publisher)
DMAPMdnsPublisher *publisher)
{
if (state == AVAHI_ENTRY_GROUP_ESTABLISHED) {
g_slist_foreach (publisher->priv->service, (GFunc) emit_published, publisher);
......@@ -112,8 +112,8 @@ entry_group_cb (AvahiEntryGroup *group,
}
static gboolean
create_service (struct DmapMdnsPublisherService *service,
DmapMdnsPublisher *publisher,
create_service (struct DMAPMdnsPublisherService *service,
DMAPMdnsPublisher *publisher,
GError **error)
{
int ret;
......@@ -164,7 +164,7 @@ create_service (struct DmapMdnsPublisherService *service,
}
static gboolean
create_services (DmapMdnsPublisher *publisher,
create_services (DMAPMdnsPublisher *publisher,
GError **error)
{
GSList *ptr;
......@@ -211,19 +211,19 @@ create_services (DmapMdnsPublisher *publisher,
}
static gboolean
refresh_services (DmapMdnsPublisher *publisher,
refresh_services (DMAPMdnsPublisher *publisher,
GError **error)
{
return create_services (publisher, error);
}
static struct DmapMdnsPublisherService *
static struct DMAPMdnsPublisherService *
find_service_by_port (GSList *list, guint port)
{
GSList *ptr;
for (ptr = list; ptr; ptr = g_slist_next (ptr)) {
if (port == ((struct DmapMdnsPublisherService *) ptr->data)->port)
if (port == ((struct DMAPMdnsPublisherService *) ptr->data)->port)
break;
}
......@@ -231,12 +231,12 @@ find_service_by_port (GSList *list, guint port)
}
gboolean
dmap_mdns_publisher_rename_at_port (DmapMdnsPublisher *publisher,
dmap_mdns_publisher_rename_at_port (DMAPMdnsPublisher *publisher,
guint port,
const char *name,
GError **error)
{
struct DmapMdnsPublisherService *ptr;
struct DMAPMdnsPublisherService *ptr;
g_return_val_if_fail (publisher != NULL, FALSE);
......@@ -262,7 +262,7 @@ dmap_mdns_publisher_rename_at_port (DmapMdnsPublisher *publisher,
}
gboolean
dmap_mdns_publisher_publish (DmapMdnsPublisher *publisher,
dmap_mdns_publisher_publish (DMAPMdnsPublisher *publisher,
const char *name,
guint port,
const char *type_of_service,
......@@ -270,7 +270,7 @@ dmap_mdns_publisher_publish (DmapMdnsPublisher *publisher,
gchar **txt_records,
GError **error)
{
struct DmapMdnsPublisherService *service;
struct DMAPMdnsPublisherService *service;
if (publisher->priv->client == NULL) {
g_set_error (error,
......@@ -282,7 +282,7 @@ dmap_mdns_publisher_publish (DmapMdnsPublisher *publisher,
}
service = g_new (struct DmapMdnsPublisherService, 1);
service = g_new (struct DMAPMdnsPublisherService, 1);
service->name = g_strdup(name);
service->port = port;
......@@ -296,7 +296,7 @@ dmap_mdns_publisher_publish (DmapMdnsPublisher *publisher,
}
static void
free_service (struct DmapMdnsPublisherService *service, gpointer user_data)
free_service (struct DMAPMdnsPublisherService *service, gpointer user_data)
{
g_free (service->name);
g_free (service->type_of_service);
......@@ -304,11 +304,11 @@ free_service (struct DmapMdnsPublisherService *service, gpointer user_data)
}
gboolean
dmap_mdns_publisher_withdraw (DmapMdnsPublisher *publisher,
dmap_mdns_publisher_withdraw (DMAPMdnsPublisher *publisher,
guint port,
GError **error)
{
struct DmapMdnsPublisherService *ptr;
struct DMAPMdnsPublisherService *ptr;
if (publisher->priv->client == NULL) {
g_set_error (error,
......@@ -390,7 +390,7 @@ dmap_mdns_publisher_constructor (GType type,
}
static void
dmap_mdns_publisher_class_init (DmapMdnsPublisherClass *klass)
dmap_mdns_publisher_class_init (DMAPMdnsPublisherClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
......@@ -403,7 +403,7 @@ dmap_mdns_publisher_class_init (DmapMdnsPublisherClass *klass)
g_signal_new ("published",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (DmapMdnsPublisherClass, published),
G_STRUCT_OFFSET (DMAPMdnsPublisherClass, published),
NULL,
NULL,
g_cclosure_marshal_VOID__STRING,
......@@ -413,18 +413,18 @@ dmap_mdns_publisher_class_init (DmapMdnsPublisherClass *klass)
g_signal_new ("name-collision",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (DmapMdnsPublisherClass, name_collision),
G_STRUCT_OFFSET (DMAPMdnsPublisherClass, name_collision),
NULL,
NULL,
g_cclosure_marshal_VOID__STRING,
G_TYPE_NONE,
1, G_TYPE_STRING);
g_type_class_add_private (klass, sizeof (DmapMdnsPublisherPrivate));
g_type_class_add_private (klass, sizeof (DMAPMdnsPublisherPrivate));
}
static void
dmap_mdns_publisher_init (DmapMdnsPublisher *publisher)
dmap_mdns_publisher_init (DMAPMdnsPublisher *publisher)
{
publisher->priv = DMAP_MDNS_PUBLISHER_GET_PRIVATE (publisher);
......@@ -436,7 +436,7 @@ dmap_mdns_publisher_init (DmapMdnsPublisher *publisher)
static void
dmap_mdns_publisher_finalize (GObject *object)
{
DmapMdnsPublisher *publisher;
DMAPMdnsPublisher *publisher;
g_return_if_fail (object != NULL);
g_return_if_fail (IS_DMAP_MDNS_PUBLISHER (object));
......@@ -468,7 +468,7 @@ dmap_mdns_publisher_finalize (GObject *object)
G_OBJECT_CLASS (dmap_mdns_publisher_parent_class)->finalize (object);
}
DmapMdnsPublisher *
DMAPMdnsPublisher *
dmap_mdns_publisher_new (void)
{
if (publisher_object) {
......
......@@ -25,9 +25,9 @@
#include "dmap-mdns-publisher.h"
#define DMAP_MDNS_PUBLISHER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_DMAP_MDNS_PUBLISHER, DmapMdnsPublisherPrivate))
#define DMAP_MDNS_PUBLISHER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_DMAP_MDNS_PUBLISHER, DMAPMdnsPublisherPrivate))
struct DmapMdnsPublisherPrivate
struct DMAPMdnsPublisherPrivate
{
DNSServiceRef sdref;
char *name;
......@@ -41,7 +41,7 @@ enum {
static guint signals [LAST_SIGNAL] = { 0, };
G_DEFINE_TYPE (DmapMdnsPublisher, dmap_mdns_publisher, G_TYPE_OBJECT)
G_DEFINE_TYPE (DMAPMdnsPublisher, dmap_mdns_publisher, G_TYPE_OBJECT)
static gpointer publisher_object = NULL;
......@@ -55,7 +55,7 @@ dmap_mdns_publisher_error_quark (void)
}
gboolean
dmap_mdns_publisher_rename_at_port (DmapMdnsPublisher *publisher,
dmap_mdns_publisher_rename_at_port (DMAPMdnsPublisher *publisher,
guint port,
const char *name,
GError **error)
......@@ -66,7 +66,7 @@ dmap_mdns_publisher_rename_at_port (DmapMdnsPublisher *publisher,
}
gboolean
dmap_mdns_publisher_publish (DmapMdnsPublisher *publisher,
dmap_mdns_publisher_publish (DMAPMdnsPublisher *publisher,
const char *name,
guint port,
const char *type_of_service,
......@@ -110,7 +110,7 @@ dmap_mdns_publisher_publish (DmapMdnsPublisher *publisher,
}
gboolean
dmap_mdns_publisher_withdraw (DmapMdnsPublisher *publisher,
dmap_mdns_publisher_withdraw (DMAPMdnsPublisher *publisher,
guint port,
GError **error)
{
......@@ -148,7 +148,7 @@ dmap_mdns_publisher_get_property (GObject *object,
static void
dmap_mdns_publisher_finalize (GObject *object)
{
DmapMdnsPublisher *publisher;
DMAPMdnsPublisher *publisher;
g_return_if_fail (object != NULL);
g_return_if_fail (IS_DMAP_MDNS_PUBLISHER (object));
......@@ -163,7 +163,7 @@ dmap_mdns_publisher_finalize (GObject *object)
}
static void
dmap_mdns_publisher_class_init (DmapMdnsPublisherClass *klass)
dmap_mdns_publisher_class_init (DMAPMdnsPublisherClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
......@@ -175,7 +175,7 @@ dmap_mdns_publisher_class_init (DmapMdnsPublisherClass *klass)
g_signal_new ("published",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (DmapMdnsPublisherClass, published),
G_STRUCT_OFFSET (DMAPMdnsPublisherClass, published),
NULL,
NULL,
g_cclosure_marshal_VOID__STRING,
......@@ -185,23 +185,23 @@ dmap_mdns_publisher_class_init (DmapMdnsPublisherClass *klass)
g_signal_new ("name-collision",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (DmapMdnsPublisherClass, name_collision),
G_STRUCT_OFFSET (DMAPMdnsPublisherClass, name_collision),
NULL,
NULL,
g_cclosure_marshal_VOID__STRING,
G_TYPE_NONE,
1, G_TYPE_STRING);
g_type_class_add_private (klass, sizeof (DmapMdnsPublisherPrivate));
g_type_class_add_private (klass, sizeof (DMAPMdnsPublisherPrivate));
}
static void
dmap_mdns_publisher_init (DmapMdnsPublisher *publisher)
dmap_mdns_publisher_init (DMAPMdnsPublisher *publisher)
{
publisher->priv = DMAP_MDNS_PUBLISHER_GET_PRIVATE (publisher);
}
DmapMdnsPublisher *
DMAPMdnsPublisher *
dmap_mdns_publisher_new (void)
{
if (publisher_object) {
......
......@@ -32,36 +32,36 @@
G_BEGIN_DECLS
#define TYPE_DMAP_MDNS_PUBLISHER (dmap_mdns_publisher_get_type ())
#define DMAP_MDNS_PUBLISHER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_DMAP_MDNS_PUBLISHER, DmapMdnsPublisher))
#define DMAP_MDNS_PUBLISHER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), TYPE_DMAP_MDNS_PUBLISHER, DmapMdnsPublisherClass))
#define DMAP_MDNS_PUBLISHER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_DMAP_MDNS_PUBLISHER, DMAPMdnsPublisher))
#define DMAP_MDNS_PUBLISHER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), TYPE_DMAP_MDNS_PUBLISHER, DMAPMdnsPublisherClass))
#define IS_DMAP_MDNS_PUBLISHER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_DMAP_MDNS_PUBLISHER))
#define IS_DMAP_MDNS_PUBLISHER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_DMAP_MDNS_PUBLISHER))
#define DMAP_MDNS_PUBLISHER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_DMAP_MDNS_PUBLISHER, DmapMdnsPublisherClass))
#define DMAP_MDNS_PUBLISHER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_DMAP_MDNS_PUBLISHER, DMAPMdnsPublisherClass))
typedef struct DmapMdnsPublisherPrivate DmapMdnsPublisherPrivate;
typedef struct DMAPMdnsPublisherPrivate DMAPMdnsPublisherPrivate;
typedef struct
{
GObject object;
DmapMdnsPublisherPrivate *priv;
} DmapMdnsPublisher;
DMAPMdnsPublisherPrivate *priv;
} DMAPMdnsPublisher;
typedef struct
{
GObjectClass parent_class;
void (* published) (DmapMdnsPublisher *publisher,
void (* published) (DMAPMdnsPublisher *publisher,
const char *name);
void (* name_collision) (DmapMdnsPublisher *publisher,
void (* name_collision) (DMAPMdnsPublisher *publisher,
const char *name);
} DmapMdnsPublisherClass;
} DMAPMdnsPublisherClass;
typedef enum
{
DMAP_MDNS_PUBLISHER_ERROR_NOT_RUNNING,
DMAP_MDNS_PUBLISHER_ERROR_FAILED,
} DmapMdnsPublisherError;
} DMAPMdnsPublisherError;
#define DMAP_MDNS_PUBLISHER_ERROR dmap_mdns_publisher_error_quark ()
......@@ -69,19 +69,19 @@ GQuark dmap_mdns_publisher_error_quark (void);
GType dmap_mdns_publisher_get_type (void);
DmapMdnsPublisher *dmap_mdns_publisher_new (void);
gboolean dmap_mdns_publisher_publish (DmapMdnsPublisher *publisher,
DMAPMdnsPublisher *dmap_mdns_publisher_new (void);
gboolean dmap_mdns_publisher_publish (DMAPMdnsPublisher *publisher,
const char *name,
guint port,
const char *type_of_service,
gboolean password_required,
gchar **txt_records,
GError **error);
gboolean dmap_mdns_publisher_rename_at_port (DmapMdnsPublisher *publisher,
gboolean dmap_mdns_publisher_rename_at_port (DMAPMdnsPublisher *publisher,
guint port,
const char *name,
GError **error);
gboolean dmap_mdns_publisher_withdraw (DmapMdnsPublisher *publisher,
gboolean dmap_mdns_publisher_withdraw (DMAPMdnsPublisher *publisher,
guint port,
GError **error);
......
......@@ -75,7 +75,7 @@ struct DMAPSharePrivate {
/* mDNS/DNS-SD publishing things */
gboolean server_active;
gboolean published;
DmapMdnsPublisher *publisher;
DMAPMdnsPublisher *publisher;
/* HTTP server things */
SoupServer *server;
......@@ -669,14 +669,14 @@ dmap_share_class_init (DMAPShareClass *klass)
g_type_class_add_private (klass, sizeof (DMAPSharePrivate));
}
static void published_adapter (DmapMdnsPublisher *publisher,
static void published_adapter (DMAPMdnsPublisher *publisher,
const char *name,
DMAPShare *share)
{
DMAP_SHARE_GET_CLASS (share)->published (share, publisher, name);
}
static void name_collision_adapter (DmapMdnsPublisher *publisher,
static void name_collision_adapter (DMAPMdnsPublisher *publisher,
const char *name,
DMAPShare *share)
{
......@@ -908,7 +908,7 @@ _dmap_share_soup_auth_filter (SoupAuthDomain *auth_domain,
void
_dmap_share_published (DMAPShare *share,
DmapMdnsPublisher *publisher,
DMAPMdnsPublisher *publisher,
const char *name)
{
gchar *nameprop;
......@@ -930,7 +930,7 @@ _dmap_share_published (DMAPShare *share,
void
_dmap_share_name_collision (DMAPShare *share,
DmapMdnsPublisher *publisher,
DMAPMdnsPublisher *publisher,
const char *name)
{
gchar *nameprop;
......
......@@ -154,11 +154,11 @@ typedef struct {
/* Virtual methods: MDNS callbacks */
void (*published) (DMAPShare *share,
DmapMdnsPublisher *publisher,
DMAPMdnsPublisher *publisher,
const char *name);
void (*name_collision)(DMAPShare *share,
DmapMdnsPublisher *publisher,
DMAPMdnsPublisher *publisher,
const char *name);
/* Virtual methods: */
......@@ -272,11 +272,11 @@ void _dmap_share_ctrl_int (DMAPShare *share,
/* Virtual methods: MDNS callbacks */
void _dmap_share_published (DMAPShare *share,
DmapMdnsPublisher *publisher,
DMAPMdnsPublisher *publisher,
const char *name);
void _dmap_share_name_collision(DMAPShare *share,
DmapMdnsPublisher *publisher,
DMAPMdnsPublisher *publisher,
const char *name);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment