projects
/
cascardo
/
gnio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6ab527e
)
Removed some warnings, cleaned up includes, and prepared
author
Samuel Cormier-Iijima
<sciyoshi@gmail.com>
Sun, 2 Mar 2008 01:18:22 +0000
(20:18 -0500)
committer
Samuel Cormier-Iijima
<sciyoshi@gmail.com>
Sun, 2 Mar 2008 01:18:22 +0000
(20:18 -0500)
Network*Streams
gnio/Makefile.am
patch
|
blob
|
history
gnio/gnetworkinputstream.c
patch
|
blob
|
history
gnio/gnetworkinputstream.h
patch
|
blob
|
history
gnio/gnetworkoutputstream.c
patch
|
blob
|
history
gnio/gnetworkoutputstream.h
patch
|
blob
|
history
gnio/gtcpclient.h
patch
|
blob
|
history
gnio/gtcpserver.c
patch
|
blob
|
history
test/test-tcp-client.c
patch
|
blob
|
history
diff --git
a/gnio/Makefile.am
b/gnio/Makefile.am
index
62cc1bf
..
74098c3
100644
(file)
--- a/
gnio/Makefile.am
+++ b/
gnio/Makefile.am
@@
-1,11
+1,20
@@
NULL =
NULL =
-INCLUDES = \
- $(SAMBA_CFLAGS) \
- -I$(top_srcdir) \
- -I$(top_builddir) \
- $(GLIB_CFLAGS) \
- -DG_DISABLE_DEPRECATED
+#INCLUDES = \
+# $(SAMBA_CFLAGS) \
+# -I$(top_srcdir) \
+# -I$(top_builddir) \
+# $(GLIB_CFLAGS) \
+# -DG_DISABLE_DEPRECATED
+
+AM_CPPFLAGS = \
+ -DG_LOG_DOMAIN=\"GLib-GIO\" \
+ -I$(top_builddir) \
+ -I$(top_srcdir) \
+ $(GLIB_CFLAGS) \
+ $(GLIB_DEBUG_FLAGS) \
+ -DG_DISABLE_DEPRECATED \
+ -DGIO_COMPILATION
lib_LTLIBRARIES=libgnio.la
lib_LTLIBRARIES=libgnio.la
diff --git
a/gnio/gnetworkinputstream.c
b/gnio/gnetworkinputstream.c
index
50eb1a6
..
a7bdbb6
100644
(file)
--- a/
gnio/gnetworkinputstream.c
+++ b/
gnio/gnetworkinputstream.c
@@
-25,25
+25,7
@@
#include <glib.h>
#include <gio/gio.h>
#include <glib.h>
#include <gio/gio.h>
-#include <string.h>
-#ifndef G_OS_WIN32
-# include <netinet/in.h>
-# include <arpa/inet.h>
-# include <netdb.h>
-#else
-# include <winsock2.h>
-# include <winerror.h>
-# include <ws2tcpip.h>
-# undef HAVE_GETADDRINFO
-# define HAVE_GETHOSTBYNAME_THREADSAFE 1
-#endif
-#include <errno.h>
-
-#include "ginetaddress.h"
-#include "ginet4address.h"
-#include "ginet6address.h"
#include "gnetworkinputstream.h"
#include "gnetworkinputstream.h"
-#include "gnioerror.h"
G_DEFINE_TYPE (GNetworkInputStream, g_network_input_stream, G_TYPE_INPUT_STREAM);
G_DEFINE_TYPE (GNetworkInputStream, g_network_input_stream, G_TYPE_INPUT_STREAM);
diff --git
a/gnio/gnetworkinputstream.h
b/gnio/gnetworkinputstream.h
index
fb51da5
..
9d6d42e
100644
(file)
--- a/
gnio/gnetworkinputstream.h
+++ b/
gnio/gnetworkinputstream.h
@@
-27,8
+27,6
@@
#include <glib-object.h>
#include <gio/gio.h>
#include <glib-object.h>
#include <gio/gio.h>
-#include "gsocket.h"
-
G_BEGIN_DECLS
#define G_TYPE_NETWORK_INPUT_STREAM (g_socket_get_type ())
G_BEGIN_DECLS
#define G_TYPE_NETWORK_INPUT_STREAM (g_socket_get_type ())
@@
-53,7
+51,7
@@
struct _GNetworkInputStreamClass
GType g_network_input_stream_get_type (void) G_GNUC_CONST;
GType g_network_input_stream_get_type (void) G_GNUC_CONST;
-GNetworkInputStream * g_network_input_stream_new (
GSocket *socket
);
+GNetworkInputStream * g_network_input_stream_new (
void
);
G_END_DECLS
G_END_DECLS
diff --git
a/gnio/gnetworkoutputstream.c
b/gnio/gnetworkoutputstream.c
index
eecd2db
..
c32a470
100644
(file)
--- a/
gnio/gnetworkoutputstream.c
+++ b/
gnio/gnetworkoutputstream.c
@@
-25,25
+25,7
@@
#include <glib.h>
#include <gio/gio.h>
#include <glib.h>
#include <gio/gio.h>
-#include <string.h>
-#ifndef G_OS_WIN32
-# include <netinet/in.h>
-# include <arpa/inet.h>
-# include <netdb.h>
-#else
-# include <winsock2.h>
-# include <winerror.h>
-# include <ws2tcpip.h>
-# undef HAVE_GETADDRINFO
-# define HAVE_GETHOSTBYNAME_THREADSAFE 1
-#endif
-#include <errno.h>
-
-#include "ginetaddress.h"
-#include "ginet4address.h"
-#include "ginet6address.h"
#include "gnetworkoutputstream.h"
#include "gnetworkoutputstream.h"
-#include "gnioerror.h"
G_DEFINE_TYPE (GNetworkOutputStream, g_network_output_stream, G_TYPE_OUTPUT_STREAM);
G_DEFINE_TYPE (GNetworkOutputStream, g_network_output_stream, G_TYPE_OUTPUT_STREAM);
diff --git
a/gnio/gnetworkoutputstream.h
b/gnio/gnetworkoutputstream.h
index
b3dfee0
..
84615e8
100644
(file)
--- a/
gnio/gnetworkoutputstream.h
+++ b/
gnio/gnetworkoutputstream.h
@@
-27,8
+27,6
@@
#include <glib-object.h>
#include <gio/gio.h>
#include <glib-object.h>
#include <gio/gio.h>
-#include "gsocket.h"
-
G_BEGIN_DECLS
#define G_TYPE_NETWORK_OUTPUT_STREAM (g_socket_get_type ())
G_BEGIN_DECLS
#define G_TYPE_NETWORK_OUTPUT_STREAM (g_socket_get_type ())
@@
-53,7
+51,7
@@
struct _GNetworkOutputStreamClass
GType g_network_output_stream_get_type (void) G_GNUC_CONST;
GType g_network_output_stream_get_type (void) G_GNUC_CONST;
-GNetworkOutputStream * g_network_output_stream_new (
GSocket *socket
);
+GNetworkOutputStream * g_network_output_stream_new (
void
);
G_END_DECLS
G_END_DECLS
diff --git
a/gnio/gtcpclient.h
b/gnio/gtcpclient.h
index
ff71d73
..
dd87d63
100644
(file)
--- a/
gnio/gtcpclient.h
+++ b/
gnio/gtcpclient.h
@@
-28,6
+28,8
@@
#include <gio/gio.h>
#include <gnio/ginetsocketaddress.h>
#include <gio/gio.h>
#include <gnio/ginetsocketaddress.h>
+#include <gnio/gnetworkinputstream.h>
+#include <gnio/gnetworkoutputstream.h>
G_BEGIN_DECLS
G_BEGIN_DECLS
@@
-54,27
+56,31
@@
struct _GTcpClientClass
GObjectClass parent_class;
};
GObjectClass parent_class;
};
-GType
g_tcp_client_get_type
(void) G_GNUC_CONST;
+GType
g_tcp_client_get_type
(void) G_GNUC_CONST;
-GTcpClient *
g_tcp_client_new
(const gchar *hostname,
- gushort port);
+GTcpClient *
g_tcp_client_new
(const gchar *hostname,
+
gushort port);
-GTcpClient *
g_tcp_client_new_from_address
(GInetSocketAddress *address);
+GTcpClient *
g_tcp_client_new_from_address
(GInetSocketAddress *address);
-gboolean g_tcp_client_connect (GTcpClient *client,
- GCancellable *cancellable,
- GError **error);
+GNetworkInputStream * g_tcp_client_get_input_stream (GTcpClient *client);
-void g_tcp_client_connect_async (GTcpClient *client,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
+GNetworkOutputStream * g_tcp_client_get_output_stream (GTcpClient *client);
-gboolean
g_tcp_client_connect_finish
(GTcpClient *client,
-
GAsyncResult *result
,
- GError **error);
+gboolean
g_tcp_client_connect
(GTcpClient *client,
+
GCancellable *cancellable
,
+
GError **error);
-void g_tcp_client_close (GTcpClient *client);
+void g_tcp_client_connect_async (GTcpClient *client,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean g_tcp_client_connect_finish (GTcpClient *client,
+ GAsyncResult *result,
+ GError **error);
+
+void g_tcp_client_close (GTcpClient *client);
G_END_DECLS
G_END_DECLS
diff --git
a/gnio/gtcpserver.c
b/gnio/gtcpserver.c
index
6697a5f
..
aab8c1c
100644
(file)
--- a/
gnio/gtcpserver.c
+++ b/
gnio/gtcpserver.c
@@
-45,7
+45,7
@@
struct _GTcpServerPrivate
static void
g_tcp_server_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
{
static void
g_tcp_server_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
{
- GTcpServer *server = G_TCP_SERVER (object);
+ GTcpServer *server
G_GNUC_UNUSED
= G_TCP_SERVER (object);
switch (prop_id)
{
switch (prop_id)
{
@@
-57,7
+57,7
@@
g_tcp_server_get_property (GObject *object, guint prop_id, GValue *value, GParam
static void
g_tcp_server_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
static void
g_tcp_server_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
- GTcpServer *server = G_TCP_SERVER (object);
+ GTcpServer *server
G_GNUC_UNUSED
= G_TCP_SERVER (object);
switch (prop_id)
{
switch (prop_id)
{
@@
-69,7
+69,7
@@
g_tcp_server_set_property (GObject *object, guint prop_id, const GValue *value,
static void
g_tcp_server_finalize (GObject *object)
{
static void
g_tcp_server_finalize (GObject *object)
{
- GTcpServer *server = G_TCP_SERVER (object);
+ GTcpServer *server
G_GNUC_UNUSED
= G_TCP_SERVER (object);
if (G_OBJECT_CLASS (g_tcp_server_parent_class)->finalize)
(*G_OBJECT_CLASS (g_tcp_server_parent_class)->finalize) (object);
if (G_OBJECT_CLASS (g_tcp_server_parent_class)->finalize)
(*G_OBJECT_CLASS (g_tcp_server_parent_class)->finalize) (object);
@@
-78,7
+78,7
@@
g_tcp_server_finalize (GObject *object)
static void
g_tcp_server_dispose (GObject *object)
{
static void
g_tcp_server_dispose (GObject *object)
{
- GTcpServer *server = G_TCP_SERVER (object);
+ GTcpServer *server
G_GNUC_UNUSED
= G_TCP_SERVER (object);
if (G_OBJECT_CLASS (g_tcp_server_parent_class)->dispose)
(*G_OBJECT_CLASS (g_tcp_server_parent_class)->dispose) (object);
if (G_OBJECT_CLASS (g_tcp_server_parent_class)->dispose)
(*G_OBJECT_CLASS (g_tcp_server_parent_class)->dispose) (object);
diff --git
a/test/test-tcp-client.c
b/test/test-tcp-client.c
index
d9c7679
..
f13aae8
100644
(file)
--- a/
test/test-tcp-client.c
+++ b/
test/test-tcp-client.c
@@
-35,7
+35,7
@@
int main (int argc, char *argv[])
if (!g_tcp_client_connect (client, NULL, &error)) {
g_warning (error->message);
if (!g_tcp_client_connect (client, NULL, &error)) {
g_warning (error->message);
- return;
+ return
1
;
}
g_print ("connected!\n");
}
g_print ("connected!\n");