summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/idle-connection-manager.c2
-rw-r--r--src/idle-connection-manager.h1
-rw-r--r--src/idle-connection.c56
-rw-r--r--src/idle-connection.h16
-rw-r--r--src/idle-debug.c3
-rw-r--r--src/idle-dns-resolver.c3
-rw-r--r--src/idle-dns-resolver.h8
-rw-r--r--src/idle-handles.c8
-rw-r--r--src/idle-handles.h4
-rw-r--r--src/idle-im-channel.c19
-rw-r--r--src/idle-im-factory.c12
-rw-r--r--src/idle-im-factory.h2
-rw-r--r--src/idle-muc-channel.c30
-rw-r--r--src/idle-muc-channel.h10
-rw-r--r--src/idle-muc-factory.c12
-rw-r--r--src/idle-muc-factory.h2
-rw-r--r--src/idle-server-connection-iface.c2
-rw-r--r--src/idle-server-connection.c25
-rw-r--r--src/idle-text.c5
-rw-r--r--src/idle-text.h2
20 files changed, 87 insertions, 135 deletions
diff --git a/src/idle-connection-manager.c b/src/idle-connection-manager.c
index 0969f4f..46a7039 100644
--- a/src/idle-connection-manager.c
+++ b/src/idle-connection-manager.c
@@ -20,8 +20,8 @@
#include "idle-connection-manager.h"
+#define DBUS_API_SUBJECT_TO_CHANGE
#include <dbus/dbus-protocol.h>
-
#include <telepathy-glib/enums.h>
#include "idle-connection.h"
diff --git a/src/idle-connection-manager.h b/src/idle-connection-manager.h
index 1d324f5..8c3d3a0 100644
--- a/src/idle-connection-manager.h
+++ b/src/idle-connection-manager.h
@@ -22,7 +22,6 @@
#define __IDLE_CONNECTION_MANAGER_H__
#include <glib-object.h>
-
#include <telepathy-glib/base-connection-manager.h>
G_BEGIN_DECLS
diff --git a/src/idle-connection.c b/src/idle-connection.c
index a79bd54..286665b 100644
--- a/src/idle-connection.c
+++ b/src/idle-connection.c
@@ -18,56 +18,34 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "idle-connection.h"
+
#include <config.h>
-#define DBUS_API_SUBJECT_TO_CHANGE
+/* strnlen */
+#define __USE_GNU
+#include <string.h>
+#include <time.h>
+#define DBUS_API_SUBJECT_TO_CHANGE
#include <dbus/dbus-glib.h>
-#include <dbus/dbus-glib-lowlevel.h>
-#include <telepathy-glib/intset.h>
#include <telepathy-glib/enums.h>
-#include <telepathy-glib/interfaces.h>
#include <telepathy-glib/errors.h>
-#include <telepathy-glib/dbus.h>
+#include <telepathy-glib/interfaces.h>
#include <telepathy-glib/svc-connection.h>
#include <telepathy-glib/channel-factory-iface.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <time.h>
-#include <errno.h>
-
-/* strnlen */
-#define __USE_GNU
-#include <string.h>
-#include <ctype.h>
-
-#include <unistd.h>
-#include <pthread.h>
-#include <sys/poll.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-
-#include "idle-handles.h"
-#include "idle-muc-channel.h"
-
+#define IDLE_DEBUG_FLAG IDLE_DEBUG_CONNECTION
#include "idle-ctcp.h"
+#include "idle-debug.h"
+#include "idle-handles.h"
+#include "idle-im-factory.h"
+#include "idle-muc-factory.h"
#include "idle-parser.h"
#include "idle-server-connection.h"
-#include "idle-ssl-server-connection.h"
#include "idle-server-connection-iface.h"
-#include "idle-im-factory.h"
-#include "idle-muc-factory.h"
-
-#include "idle-connection.h"
-
-#define IDLE_DEBUG_FLAG IDLE_DEBUG_CONNECTION
-#include "idle-debug.h"
+#include "idle-ssl-server-connection.h"
#include "extensions/extensions.h" /* Renaming */
@@ -195,6 +173,8 @@ static void irc_handshakes(IdleConnection *conn);
static void send_quit_request(IdleConnection *conn);
static void connection_connect_cb(IdleConnection *conn, gboolean success, TpConnectionStatusReason fail_reason);
static void connection_disconnect_cb(IdleConnection *conn, TpConnectionStatusReason reason);
+static gboolean idle_connection_hton(IdleConnection *obj, const gchar *input, gchar **output, GError **_error);
+static void idle_connection_ntoh(IdleConnection *obj, const gchar *input, gchar **output);
static void idle_connection_init (IdleConnection *obj) {
IdleConnectionPrivate *priv = IDLE_CONNECTION_GET_PRIVATE (obj);
@@ -973,7 +953,7 @@ static void idle_connection_set_aliases(TpSvcConnectionInterfaceAliasing *iface,
tp_svc_connection_interface_aliasing_return_from_set_aliases(context);
}
-gboolean idle_connection_hton(IdleConnection *obj, const gchar *input, gchar **output, GError **_error) {
+static gboolean idle_connection_hton(IdleConnection *obj, const gchar *input, gchar **output, GError **_error) {
IdleConnectionPrivate *priv = IDLE_CONNECTION_GET_PRIVATE(obj);
GError *error = NULL;
gsize bytes_written;
@@ -998,7 +978,7 @@ gboolean idle_connection_hton(IdleConnection *obj, const gchar *input, gchar **o
return TRUE;
}
-void idle_connection_ntoh(IdleConnection *obj, const gchar *input, gchar **output) {
+static void idle_connection_ntoh(IdleConnection *obj, const gchar *input, gchar **output) {
IdleConnectionPrivate *priv = IDLE_CONNECTION_GET_PRIVATE(obj);
GError *error = NULL;
gsize bytes_written;
diff --git a/src/idle-connection.h b/src/idle-connection.h
index 1cc7259..eb91525 100644
--- a/src/idle-connection.h
+++ b/src/idle-connection.h
@@ -22,20 +22,18 @@
#define __IDLE_CONNECTION_H__
#include <glib-object.h>
-#include <dbus/dbus-glib.h>
-
#include <telepathy-glib/base-connection.h>
+#include <telepathy-glib/handle.h>
-typedef struct _IdleConnection IdleConnection;
-typedef struct _IdleConnectionClass IdleConnectionClass;
-
-#include "idle-handles.h"
#include "idle-parser.h"
#define IRC_MSG_MAXLEN 510
G_BEGIN_DECLS
+typedef struct _IdleConnection IdleConnection;
+typedef struct _IdleConnectionClass IdleConnectionClass;
+
struct _IdleConnectionClass {
TpBaseConnectionClass parent_class;
};
@@ -61,13 +59,9 @@ GType idle_connection_get_type(void);
#define IDLE_CONNECTION_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), IDLE_TYPE_CONNECTION, IdleConnectionClass))
-void idle_connection_send(IdleConnection *conn, const gchar *msg);
-
void idle_connection_canon_nick_receive(IdleConnection *conn, TpHandle handle, const gchar *canon_nick);
void idle_connection_emit_queued_aliases_changed(IdleConnection *conn);
-
-gboolean idle_connection_hton(IdleConnection *obj, const gchar *input, gchar **output, GError **error);
-void idle_connection_ntoh(IdleConnection *obj, const gchar *input, gchar **output);
+void idle_connection_send(IdleConnection *conn, const gchar *msg);
G_END_DECLS
diff --git a/src/idle-debug.c b/src/idle-debug.c
index 83cc9b3..3300331 100644
--- a/src/idle-debug.c
+++ b/src/idle-debug.c
@@ -19,10 +19,7 @@
#include "idle-debug.h"
-#include <glib.h>
-
#include <stdarg.h>
-
#include <telepathy-glib/debug.h>
static IdleDebugFlags _flags = 0;
diff --git a/src/idle-dns-resolver.c b/src/idle-dns-resolver.c
index f93e619..ef9c7aa 100644
--- a/src/idle-dns-resolver.c
+++ b/src/idle-dns-resolver.c
@@ -19,9 +19,8 @@
*/
#include "idle-dns-resolver.h"
-#include <sys/types.h>
-#include <sys/socket.h>
#include <netdb.h>
+#include <sys/socket.h>
#define IDLE_DEBUG_FLAG IDLE_DEBUG_DNS
#include "idle-debug.h"
diff --git a/src/idle-dns-resolver.h b/src/idle-dns-resolver.h
index 8d3dd06..67f4997 100644
--- a/src/idle-dns-resolver.h
+++ b/src/idle-dns-resolver.h
@@ -19,10 +19,18 @@
*/
#include <glib.h>
+
+#ifndef __USE_POSIX
+#define _IDLE_DNS_RESOLVER_H_UNDEF_USE_POSIX
#define __USE_POSIX
+#endif
+
#include <sys/types.h>
#include <netdb.h>
+
+#ifdef _IDLE_DNS_RESOLVER_H_UNDEF_USE_POSIX
#undef __USE_POSIX
+#endif
G_BEGIN_DECLS
diff --git a/src/idle-handles.c b/src/idle-handles.c
index 30385e0..fe59201 100644
--- a/src/idle-handles.c
+++ b/src/idle-handles.c
@@ -18,17 +18,15 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "idle-handles.h"
+
#include <glib.h>
-#include <string.h>
#include <ctype.h>
+#include <string.h>
#include <telepathy-glib/errors.h>
#include <telepathy-glib/handle-repo-dynamic.h>
-#include "idle-handles.h"
-
-#include "idle-connection.h"
-
static gboolean _nickname_is_valid(const gchar *nickname) {
gsize len;
gunichar ucs4char;
diff --git a/src/idle-handles.h b/src/idle-handles.h
index 0d30b3a..516ad9c 100644
--- a/src/idle-handles.h
+++ b/src/idle-handles.h
@@ -22,12 +22,8 @@
#define __IDLE_HANDLES_H__
#include <glib.h>
-
-#include <telepathy-glib/enums.h>
#include <telepathy-glib/handle-repo.h>
-#include "idle-connection.h"
-
G_BEGIN_DECLS
void idle_handle_repos_init(TpHandleRepoIface **handles);
diff --git a/src/idle-im-channel.c b/src/idle-im-channel.c
index 6e1029d..2dfc7ac 100644
--- a/src/idle-im-channel.c
+++ b/src/idle-im-channel.c
@@ -18,27 +18,26 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <glib.h>
+#include "idle-im-channel.h"
+
+#include <time.h>
+
+#define DBUS_API_SUBJECT_TO_CHANGE
#include <dbus/dbus-glib.h>
+#include <telepathy-glib/channel-iface.h>
+#include <telepathy-glib/dbus.h>
#include <telepathy-glib/enums.h>
#include <telepathy-glib/interfaces.h>
#include <telepathy-glib/errors.h>
-#include <telepathy-glib/dbus.h>
-#include <telepathy-glib/channel-iface.h>
#include <telepathy-glib/svc-channel.h>
-#include <time.h>
-
+#define IDLE_DEBUG_FLAG IDLE_DEBUG_IM
#include "idle-connection.h"
+#include "idle-debug.h"
#include "idle-handles.h"
#include "idle-text.h"
-#include "idle-im-channel.h"
-
-#define IDLE_DEBUG_FLAG IDLE_DEBUG_IM
-#include "idle-debug.h"
-
static void channel_iface_init (gpointer, gpointer);
static void text_iface_init (gpointer, gpointer);
diff --git a/src/idle-im-factory.c b/src/idle-im-factory.c
index 4b20ca4..6dd13ad 100644
--- a/src/idle-im-factory.c
+++ b/src/idle-im-factory.c
@@ -20,18 +20,16 @@
#include "idle-im-factory.h"
-#include "idle-connection.h"
-#include "idle-ctcp.h"
-#include "idle-parser.h"
-#include "idle-text.h"
-
-#include <glib.h>
-
#include <telepathy-glib/channel-factory-iface.h>
#include <telepathy-glib/interfaces.h>
#define IDLE_DEBUG_FLAG IDLE_DEBUG_IM
+#include "idle-connection.h"
+#include "idle-ctcp.h"
#include "idle-debug.h"
+#include "idle-im-channel.h"
+#include "idle-parser.h"
+#include "idle-text.h"
static void _im_factory_iface_init(gpointer g_iface, gpointer iface_data);
diff --git a/src/idle-im-factory.h b/src/idle-im-factory.h
index 1bdc8d9..2816e41 100644
--- a/src/idle-im-factory.h
+++ b/src/idle-im-factory.h
@@ -23,8 +23,6 @@
#include <glib-object.h>
-#include "idle-im-channel.h"
-
G_BEGIN_DECLS
typedef struct _IdleIMFactory IdleIMFactory;
diff --git a/src/idle-muc-channel.c b/src/idle-muc-channel.c
index 365142d..6a70bc2 100644
--- a/src/idle-muc-channel.c
+++ b/src/idle-muc-channel.c
@@ -18,31 +18,29 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <glib.h>
-#include <dbus/dbus-glib.h>
-
-#include <telepathy-glib/enums.h>
-#include <telepathy-glib/interfaces.h>
-#include <telepathy-glib/errors.h>
-#include <telepathy-glib/dbus.h>
-#include <telepathy-glib/channel-iface.h>
-#include <telepathy-glib/svc-channel.h>
-#include <telepathy-glib/svc-properties-interface.h>
+#include "idle-muc-channel.h"
-#define _GNU_SOURCE
-#include <stdlib.h>
#include <ctype.h>
+#include <stdlib.h>
#include <string.h>
#include <time.h>
-#include "idle-muc-channel.h"
+#define DBUS_API_SUBJECT_TO_CHANGE
+#include <dbus/dbus-glib.h>
-#include "idle-connection.h"
-#include "idle-handles.h"
-#include "idle-text.h"
+#include <telepathy-glib/channel-iface.h>
+#include <telepathy-glib/dbus.h>
+#include <telepathy-glib/enums.h>
+#include <telepathy-glib/errors.h>
+#include <telepathy-glib/interfaces.h>
+#include <telepathy-glib/handle.h>
+#include <telepathy-glib/svc-channel.h>
+#include <telepathy-glib/svc-properties-interface.h>
#define IDLE_DEBUG_FLAG IDLE_DEBUG_MUC
+#include "idle-connection.h"
#include "idle-debug.h"
+#include "idle-text.h"
static void channel_iface_init (gpointer, gpointer);
static void password_iface_init (gpointer, gpointer);
diff --git a/src/idle-muc-channel.h b/src/idle-muc-channel.h
index f2b3df5..7c01731 100644
--- a/src/idle-muc-channel.h
+++ b/src/idle-muc-channel.h
@@ -22,12 +22,12 @@
#define __IDLE_MUC_CHANNEL_H__
#include <glib-object.h>
+
#include <telepathy-glib/enums.h>
#include <telepathy-glib/group-mixin.h>
+#include <telepathy-glib/handle.h>
#include <telepathy-glib/text-mixin.h>
-#include "idle-handles.h"
-
G_BEGIN_DECLS
typedef struct _IdleMUCChannel IdleMUCChannel;
@@ -68,11 +68,11 @@ GType idle_muc_channel_get_type(void);
#define IDLE_MUC_CHANNEL_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), IDLE_TYPE_MUC_CHANNEL, IdleMUCChannelClass))
-void idle_muc_channel_join_attempt(IdleMUCChannel *chan);
-
void idle_muc_channel_badchannelkey(IdleMUCChannel *chan);
void idle_muc_channel_invited(IdleMUCChannel *chan, TpHandle inviter);
+gboolean idle_muc_channel_is_modechar(char c);
void idle_muc_channel_join(IdleMUCChannel *chan, TpHandle joiner);
+void idle_muc_channel_join_attempt(IdleMUCChannel *chan);
void idle_muc_channel_join_error(IdleMUCChannel *chan, IdleMUCChannelJoinError err);
void idle_muc_channel_kick(IdleMUCChannel *chan, TpHandle kicked, TpHandle kicker, const gchar *message);
void idle_muc_channel_mode(IdleMUCChannel *chan, GValueArray *args);
@@ -87,8 +87,6 @@ void idle_muc_channel_topic_full(IdleMUCChannel *chan, const TpHandle handle, co
void idle_muc_channel_topic_touch(IdleMUCChannel *chan, const TpHandle handle, const guint timestamp);
void idle_muc_channel_topic_unset(IdleMUCChannel *chan);
-gboolean idle_muc_channel_is_modechar(char c);
-
G_END_DECLS
#endif /* #ifndef __IDLE_MUC_CHANNEL_H__*/
diff --git a/src/idle-muc-factory.c b/src/idle-muc-factory.c
index 313fc74..a4eca40 100644
--- a/src/idle-muc-factory.c
+++ b/src/idle-muc-factory.c
@@ -20,20 +20,18 @@
#include "idle-muc-factory.h"
-#include "idle-connection.h"
-#include "idle-ctcp.h"
-#include "idle-parser.h"
-#include "idle-text.h"
-
#include <time.h>
-#include <glib.h>
-
#include <telepathy-glib/channel-factory-iface.h>
#include <telepathy-glib/interfaces.h>
#define IDLE_DEBUG_FLAG IDLE_DEBUG_MUC
+#include "idle-connection.h"
+#include "idle-ctcp.h"
#include "idle-debug.h"
+#include "idle-muc-channel.h"
+#include "idle-parser.h"
+#include "idle-text.h"
static void _channel_factory_iface_init(gpointer g_iface, gpointer iface_data);
diff --git a/src/idle-muc-factory.h b/src/idle-muc-factory.h
index 0801105..960cb83 100644
--- a/src/idle-muc-factory.h
+++ b/src/idle-muc-factory.h
@@ -23,8 +23,6 @@
#include <glib-object.h>
-#include "idle-muc-channel.h"
-
G_BEGIN_DECLS
typedef struct _IdleMUCFactory IdleMUCFactory;
diff --git a/src/idle-server-connection-iface.c b/src/idle-server-connection-iface.c
index 939396c..a947828 100644
--- a/src/idle-server-connection-iface.c
+++ b/src/idle-server-connection-iface.c
@@ -18,8 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <glib-object.h>
-
#include "idle-server-connection-iface.h"
#include "idle-server-connection-iface-signals-marshal.h"
diff --git a/src/idle-server-connection.c b/src/idle-server-connection.c
index 7c9aadf..d90bf7e 100644
--- a/src/idle-server-connection.c
+++ b/src/idle-server-connection.c
@@ -18,31 +18,26 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <glib.h>
-#include <glib-object.h>
+#include "idle-server-connection.h"
#include <telepathy-glib/errors.h>
-#include <unistd.h>
+#include <errno.h>
+#include <string.h>
+#include <time.h>
+
+#include <arpa/inet.h>
#include <fcntl.h>
+#include <netinet/tcp.h>
#include <sys/types.h>
#include <sys/socket.h>
-#include <time.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <errno.h>
-#include <string.h>
+#include <unistd.h>
-#include "idle-server-connection.h"
-#include "idle-server-connection-iface.h"
+#define IDLE_DEBUG_FLAG IDLE_DEBUG_NETWORK
#include "idle-connection.h"
-
#include "idle-dns-resolver.h"
-
-#define IDLE_DEBUG_FLAG IDLE_DEBUG_NETWORK
#include "idle-debug.h"
+#include "idle-server-connection-iface.h"
static void idle_server_connection_iface_init(gpointer g_iface, gpointer iface_data);
typedef struct _IdleServerConnectionPrivate IdleServerConnectionPrivate;
diff --git a/src/idle-text.c b/src/idle-text.c
index 9a0150a..104410e 100644
--- a/src/idle-text.c
+++ b/src/idle-text.c
@@ -20,14 +20,13 @@
#include "idle-text.h"
-#include <telepathy-glib/text-mixin.h>
-
#include <time.h>
#include <string.h>
-#include "idle-ctcp.h"
+#include <telepathy-glib/text-mixin.h>
#define IDLE_DEBUG_FLAG IDLE_DEBUG_TEXT
+#include "idle-ctcp.h"
#include "idle-debug.h"
void idle_text_decode(const gchar *text, TpChannelTextMessageType *type, gchar **body) {
diff --git a/src/idle-text.h b/src/idle-text.h
index 1da0c42..8aa10f5 100644
--- a/src/idle-text.h
+++ b/src/idle-text.h
@@ -22,6 +22,8 @@
#define __IDLE_TEXT_H__
#include <glib.h>
+
+#define DBUS_API_SUBJECT_TO_CHANGE
#include <dbus/dbus-glib.h>
#include "idle-connection.h"