[glib-networking/mcatanzaro/base-rebase: 14/38] base: Rename the streams to GTls[Input, Output]Stream
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib-networking/mcatanzaro/base-rebase: 14/38] base: Rename the streams to GTls[Input, Output]Stream
- Date: Fri, 10 May 2019 12:19:09 +0000 (UTC)
commit 430999d771ac14243896b0c079b92d9f844383b3
Author: Michael Catanzaro <mcatanzaro igalia com>
Date: Fri Apr 5 12:28:43 2019 -0500
base: Rename the streams to GTls[Input,Output]Stream
Instead of GTls[Input,Output]StreamBase, since these classes are not
inherited. This will be less confusing when the next commit turns them
into final types.
The naming is a bit iffy, since they are in the base/ directory after
all, but I think it will be less confusing this way.
tls/base/gtlsconnection-base.c | 8 +-
tls/base/gtlsinputstream-base.h | 60 -----------
.../{gtlsinputstream-base.c => gtlsinputstream.c} | 119 ++++++++++-----------
tls/base/gtlsinputstream.h | 60 +++++++++++
tls/base/gtlsoutputstream-base.h | 60 -----------
...{gtlsoutputstream-base.c => gtlsoutputstream.c} | 119 ++++++++++-----------
tls/base/gtlsoutputstream.h | 60 +++++++++++
tls/base/meson.build | 4 +-
8 files changed, 244 insertions(+), 246 deletions(-)
---
diff --git a/tls/base/gtlsconnection-base.c b/tls/base/gtlsconnection-base.c
index 4353694..12ecadf 100644
--- a/tls/base/gtlsconnection-base.c
+++ b/tls/base/gtlsconnection-base.c
@@ -28,8 +28,8 @@
#include <errno.h>
#include "gtlsconnection-base.h"
-#include "gtlsinputstream-base.h"
-#include "gtlsoutputstream-base.h"
+#include "gtlsinputstream.h"
+#include "gtlsoutputstream.h"
#include <glib/gi18n-lib.h>
@@ -243,13 +243,13 @@ g_tls_connection_base_set_property (GObject *object,
g_pollable_input_stream_can_poll (G_POLLABLE_INPUT_STREAM (istream)))
{
tls->base_istream = G_POLLABLE_INPUT_STREAM (istream);
- tls->tls_istream = g_tls_input_stream_base_new (tls);
+ tls->tls_istream = g_tls_input_stream_new (tls);
}
if (G_IS_POLLABLE_OUTPUT_STREAM (ostream) &&
g_pollable_output_stream_can_poll (G_POLLABLE_OUTPUT_STREAM (ostream)))
{
tls->base_ostream = G_POLLABLE_OUTPUT_STREAM (ostream);
- tls->tls_ostream = g_tls_output_stream_base_new (tls);
+ tls->tls_ostream = g_tls_output_stream_new (tls);
}
break;
diff --git a/tls/base/gtlsinputstream-base.c b/tls/base/gtlsinputstream.c
similarity index 54%
rename from tls/base/gtlsinputstream-base.c
rename to tls/base/gtlsinputstream.c
index 771c1f1..075a469 100644
--- a/tls/base/gtlsinputstream-base.c
+++ b/tls/base/gtlsinputstream.c
@@ -23,49 +23,49 @@
*/
#include "config.h"
-#include "gtlsinputstream-base.h"
+#include "gtlsinputstream.h"
#include <glib/gi18n.h>
-static void g_tls_input_stream_base_pollable_iface_init (GPollableInputStreamInterface *iface);
+static void g_tls_input_stream_pollable_iface_init (GPollableInputStreamInterface *iface);
-G_DEFINE_TYPE_WITH_CODE (GTlsInputStreamBase, g_tls_input_stream_base, G_TYPE_INPUT_STREAM,
- G_IMPLEMENT_INTERFACE (G_TYPE_POLLABLE_INPUT_STREAM,
g_tls_input_stream_base_pollable_iface_init)
+G_DEFINE_TYPE_WITH_CODE (GTlsInputStream, g_tls_input_stream, G_TYPE_INPUT_STREAM,
+ G_IMPLEMENT_INTERFACE (G_TYPE_POLLABLE_INPUT_STREAM,
g_tls_input_stream_pollable_iface_init)
)
-struct _GTlsInputStreamBasePrivate
+struct _GTlsInputStreamPrivate
{
GWeakRef weak_conn;
};
static void
-g_tls_input_stream_base_dispose (GObject *object)
+g_tls_input_stream_dispose (GObject *object)
{
- GTlsInputStreamBase *stream = G_TLS_INPUT_STREAM_BASE (object);
+ GTlsInputStream *stream = G_TLS_INPUT_STREAM (object);
g_weak_ref_set (&stream->priv->weak_conn, NULL);
- G_OBJECT_CLASS (g_tls_input_stream_base_parent_class)->dispose (object);
+ G_OBJECT_CLASS (g_tls_input_stream_parent_class)->dispose (object);
}
static void
-g_tls_input_stream_base_finalize (GObject *object)
+g_tls_input_stream_finalize (GObject *object)
{
- GTlsInputStreamBase *stream = G_TLS_INPUT_STREAM_BASE (object);
+ GTlsInputStream *stream = G_TLS_INPUT_STREAM (object);
g_weak_ref_clear (&stream->priv->weak_conn);
- G_OBJECT_CLASS (g_tls_input_stream_base_parent_class)->finalize (object);
+ G_OBJECT_CLASS (g_tls_input_stream_parent_class)->finalize (object);
}
static gssize
-g_tls_input_stream_base_read (GInputStream *stream,
- void *buffer,
- gsize count,
- GCancellable *cancellable,
- GError **error)
+g_tls_input_stream_read (GInputStream *stream,
+ void *buffer,
+ gsize count,
+ GCancellable *cancellable,
+ GError **error)
{
- GTlsInputStreamBase *tls_stream = G_TLS_INPUT_STREAM_BASE (stream);
+ GTlsInputStream *tls_stream = G_TLS_INPUT_STREAM (stream);
GTlsConnectionBase *conn;
gssize ret;
@@ -85,9 +85,9 @@ g_tls_input_stream_base_read (GInputStream *stream,
}
static gboolean
-g_tls_input_stream_base_pollable_is_readable (GPollableInputStream *pollable)
+g_tls_input_stream_pollable_is_readable (GPollableInputStream *pollable)
{
- GTlsInputStreamBase *tls_stream = G_TLS_INPUT_STREAM_BASE (pollable);
+ GTlsInputStream *tls_stream = G_TLS_INPUT_STREAM (pollable);
GTlsConnectionBase *conn;
gboolean ret;
@@ -101,10 +101,10 @@ g_tls_input_stream_base_pollable_is_readable (GPollableInputStream *pollable)
}
static GSource *
-g_tls_input_stream_base_pollable_create_source (GPollableInputStream *pollable,
- GCancellable *cancellable)
+g_tls_input_stream_pollable_create_source (GPollableInputStream *pollable,
+ GCancellable *cancellable)
{
- GTlsInputStreamBase *tls_stream = G_TLS_INPUT_STREAM_BASE (pollable);
+ GTlsInputStream *tls_stream = G_TLS_INPUT_STREAM (pollable);
GTlsConnectionBase *conn;
GSource *ret;
@@ -117,12 +117,12 @@ g_tls_input_stream_base_pollable_create_source (GPollableInputStream *pollable,
}
static gssize
-g_tls_input_stream_base_pollable_read_nonblocking (GPollableInputStream *pollable,
- void *buffer,
- gsize size,
- GError **error)
+g_tls_input_stream_pollable_read_nonblocking (GPollableInputStream *pollable,
+ void *buffer,
+ gsize size,
+ GError **error)
{
- GTlsInputStreamBase *tls_stream = G_TLS_INPUT_STREAM_BASE (pollable);
+ GTlsInputStream *tls_stream = G_TLS_INPUT_STREAM (pollable);
GTlsConnectionBase *conn;
gssize ret;
@@ -137,11 +137,11 @@ g_tls_input_stream_base_pollable_read_nonblocking (GPollableInputStream *pollab
}
static gboolean
-g_tls_input_stream_base_close (GInputStream *stream,
- GCancellable *cancellable,
- GError **error)
+g_tls_input_stream_close (GInputStream *stream,
+ GCancellable *cancellable,
+ GError **error)
{
- GTlsInputStreamBase *tls_stream = G_TLS_INPUT_STREAM_BASE (stream);
+ GTlsInputStream *tls_stream = G_TLS_INPUT_STREAM (stream);
GIOStream *conn;
gboolean ret;
@@ -171,7 +171,7 @@ close_thread (GTask *task,
gpointer task_data,
GCancellable *cancellable)
{
- GTlsInputStreamBase *tls_stream = object;
+ GTlsInputStream *tls_stream = object;
GError *error = NULL;
GIOStream *conn;
@@ -191,70 +191,69 @@ close_thread (GTask *task,
static void
-g_tls_input_stream_base_close_async (GInputStream *stream,
- int io_priority,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+g_tls_input_stream_close_async (GInputStream *stream,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
GTask *task;
task = g_task_new (stream, cancellable, callback, user_data);
- g_task_set_source_tag (task, g_tls_input_stream_base_close_async);
+ g_task_set_source_tag (task, g_tls_input_stream_close_async);
g_task_set_priority (task, io_priority);
g_task_run_in_thread (task, close_thread);
g_object_unref (task);
}
static gboolean
-g_tls_input_stream_base_close_finish (GInputStream *stream,
- GAsyncResult *result,
- GError **error)
+g_tls_input_stream_close_finish (GInputStream *stream,
+ GAsyncResult *result,
+ GError **error)
{
g_return_val_if_fail (g_task_is_valid (result, stream), FALSE);
- g_return_val_if_fail (g_task_get_source_tag (G_TASK (result)) ==
- g_tls_input_stream_base_close_async, FALSE);
+ g_return_val_if_fail (g_task_get_source_tag (G_TASK (result)) == g_tls_input_stream_close_async, FALSE);
return g_task_propagate_boolean (G_TASK (result), error);
}
static void
-g_tls_input_stream_base_class_init (GTlsInputStreamBaseClass *klass)
+g_tls_input_stream_class_init (GTlsInputStreamClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GInputStreamClass *input_stream_class = G_INPUT_STREAM_CLASS (klass);
- g_type_class_add_private (klass, sizeof (GTlsInputStreamBasePrivate));
+ g_type_class_add_private (klass, sizeof (GTlsInputStreamPrivate));
- gobject_class->dispose = g_tls_input_stream_base_dispose;
- gobject_class->finalize = g_tls_input_stream_base_finalize;
+ gobject_class->dispose = g_tls_input_stream_dispose;
+ gobject_class->finalize = g_tls_input_stream_finalize;
- input_stream_class->read_fn = g_tls_input_stream_base_read;
- input_stream_class->close_fn = g_tls_input_stream_base_close;
- input_stream_class->close_async = g_tls_input_stream_base_close_async;
- input_stream_class->close_finish = g_tls_input_stream_base_close_finish;
+ input_stream_class->read_fn = g_tls_input_stream_read;
+ input_stream_class->close_fn = g_tls_input_stream_close;
+ input_stream_class->close_async = g_tls_input_stream_close_async;
+ input_stream_class->close_finish = g_tls_input_stream_close_finish;
}
static void
-g_tls_input_stream_base_pollable_iface_init (GPollableInputStreamInterface *iface)
+g_tls_input_stream_pollable_iface_init (GPollableInputStreamInterface *iface)
{
- iface->is_readable = g_tls_input_stream_base_pollable_is_readable;
- iface->create_source = g_tls_input_stream_base_pollable_create_source;
- iface->read_nonblocking = g_tls_input_stream_base_pollable_read_nonblocking;
+ iface->is_readable = g_tls_input_stream_pollable_is_readable;
+ iface->create_source = g_tls_input_stream_pollable_create_source;
+ iface->read_nonblocking = g_tls_input_stream_pollable_read_nonblocking;
}
static void
-g_tls_input_stream_base_init (GTlsInputStreamBase *stream)
+g_tls_input_stream_init (GTlsInputStream *stream)
{
- stream->priv = G_TYPE_INSTANCE_GET_PRIVATE (stream, G_TYPE_TLS_INPUT_STREAM_BASE,
GTlsInputStreamBasePrivate);
+ stream->priv = G_TYPE_INSTANCE_GET_PRIVATE (stream, G_TYPE_TLS_INPUT_STREAM, GTlsInputStreamPrivate);
}
GInputStream *
-g_tls_input_stream_base_new (GTlsConnectionBase *conn)
+g_tls_input_stream_new (GTlsConnectionBase *conn)
{
- GTlsInputStreamBase *tls_stream;
+ GTlsInputStream *tls_stream;
- tls_stream = g_object_new (G_TYPE_TLS_INPUT_STREAM_BASE, NULL);
+ tls_stream = g_object_new (G_TYPE_TLS_INPUT_STREAM, NULL);
g_weak_ref_init (&tls_stream->priv->weak_conn, conn);
return G_INPUT_STREAM (tls_stream);
diff --git a/tls/base/gtlsinputstream.h b/tls/base/gtlsinputstream.h
new file mode 100644
index 0000000..7eff622
--- /dev/null
+++ b/tls/base/gtlsinputstream.h
@@ -0,0 +1,60 @@
+/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/*
+ * GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright 2010 Red Hat, Inc
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * In addition, when the library is used with OpenSSL, a special
+ * exception applies. Refer to the LICENSE_EXCEPTION file for details.
+ */
+
+#ifndef __G_TLS_INPUT_STREAM_H__
+#define __G_TLS_INPUT_STREAM_H__
+
+#include <gio/gio.h>
+#include "gtlsconnection-base.h"
+
+G_BEGIN_DECLS
+
+#define G_TYPE_TLS_INPUT_STREAM (g_tls_input_stream_get_type ())
+#define G_TLS_INPUT_STREAM(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), G_TYPE_TLS_INPUT_STREAM,
GTlsInputStream))
+#define G_TLS_INPUT_STREAM_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), G_TYPE_TLS_INPUT_STREAM,
GTlsInputStreamClass))
+#define G_IS_TLS_INPUT_STREAM(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), G_TYPE_TLS_INPUT_STREAM))
+#define G_IS_TLS_INPUT_STREAM_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), G_TYPE_TLS_INPUT_STREAM))
+#define G_TLS_INPUT_STREAM_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), G_TYPE_TLS_INPUT_STREAM,
GTlsInputStreamClass))
+
+typedef struct _GTlsInputStreamPrivate GTlsInputStreamPrivate;
+typedef struct _GTlsInputStreamClass GTlsInputStreamClass;
+typedef struct _GTlsInputStream GTlsInputStream;
+
+struct _GTlsInputStreamClass
+{
+ GInputStreamClass parent_class;
+};
+
+struct _GTlsInputStream
+{
+ GInputStream parent_instance;
+ GTlsInputStreamPrivate *priv;
+};
+
+GType g_tls_input_stream_get_type (void) G_GNUC_CONST;
+GInputStream *g_tls_input_stream_new (GTlsConnectionBase *conn);
+
+G_END_DECLS
+
+#endif /* __G_TLS_INPUT_STREAM_BASE_H___ */
diff --git a/tls/base/gtlsoutputstream-base.c b/tls/base/gtlsoutputstream.c
similarity index 54%
rename from tls/base/gtlsoutputstream-base.c
rename to tls/base/gtlsoutputstream.c
index 769515b..aa93d69 100644
--- a/tls/base/gtlsoutputstream-base.c
+++ b/tls/base/gtlsoutputstream.c
@@ -23,49 +23,49 @@
*/
#include "config.h"
-#include "gtlsoutputstream-base.h"
+#include "gtlsoutputstream.h"
#include <glib/gi18n.h>
-static void g_tls_output_stream_base_pollable_iface_init (GPollableOutputStreamInterface *iface);
+static void g_tls_output_stream_pollable_iface_init (GPollableOutputStreamInterface *iface);
-G_DEFINE_TYPE_WITH_CODE (GTlsOutputStreamBase, g_tls_output_stream_base, G_TYPE_OUTPUT_STREAM,
- G_IMPLEMENT_INTERFACE (G_TYPE_POLLABLE_OUTPUT_STREAM,
g_tls_output_stream_base_pollable_iface_init)
+G_DEFINE_TYPE_WITH_CODE (GTlsOutputStream, g_tls_output_stream, G_TYPE_OUTPUT_STREAM,
+ G_IMPLEMENT_INTERFACE (G_TYPE_POLLABLE_OUTPUT_STREAM,
g_tls_output_stream_pollable_iface_init)
)
-struct _GTlsOutputStreamBasePrivate
+struct _GTlsOutputStreamPrivate
{
GWeakRef weak_conn;
};
static void
-g_tls_output_stream_base_dispose (GObject *object)
+g_tls_output_stream_dispose (GObject *object)
{
- GTlsOutputStreamBase *stream = G_TLS_OUTPUT_STREAM_BASE (object);
+ GTlsOutputStream *stream = G_TLS_OUTPUT_STREAM (object);
g_weak_ref_set (&stream->priv->weak_conn, NULL);
- G_OBJECT_CLASS (g_tls_output_stream_base_parent_class)->dispose (object);
+ G_OBJECT_CLASS (g_tls_output_stream_parent_class)->dispose (object);
}
static void
-g_tls_output_stream_base_finalize (GObject *object)
+g_tls_output_stream_finalize (GObject *object)
{
- GTlsOutputStreamBase *stream = G_TLS_OUTPUT_STREAM_BASE (object);
+ GTlsOutputStream *stream = G_TLS_OUTPUT_STREAM (object);
g_weak_ref_clear (&stream->priv->weak_conn);
- G_OBJECT_CLASS (g_tls_output_stream_base_parent_class)->finalize (object);
+ G_OBJECT_CLASS (g_tls_output_stream_parent_class)->finalize (object);
}
static gssize
-g_tls_output_stream_base_write (GOutputStream *stream,
- const void *buffer,
- gsize count,
- GCancellable *cancellable,
- GError **error)
+g_tls_output_stream_write (GOutputStream *stream,
+ const void *buffer,
+ gsize count,
+ GCancellable *cancellable,
+ GError **error)
{
- GTlsOutputStreamBase *tls_stream = G_TLS_OUTPUT_STREAM_BASE (stream);
+ GTlsOutputStream *tls_stream = G_TLS_OUTPUT_STREAM (stream);
GTlsConnectionBase *conn;
gssize ret;
@@ -84,9 +84,9 @@ g_tls_output_stream_base_write (GOutputStream *stream,
}
static gboolean
-g_tls_output_stream_base_pollable_is_writable (GPollableOutputStream *pollable)
+g_tls_output_stream_pollable_is_writable (GPollableOutputStream *pollable)
{
- GTlsOutputStreamBase *tls_stream = G_TLS_OUTPUT_STREAM_BASE (pollable);
+ GTlsOutputStream *tls_stream = G_TLS_OUTPUT_STREAM (pollable);
GTlsConnectionBase *conn;
gboolean ret;
@@ -101,10 +101,10 @@ g_tls_output_stream_base_pollable_is_writable (GPollableOutputStream *pollable)
}
static GSource *
-g_tls_output_stream_base_pollable_create_source (GPollableOutputStream *pollable,
- GCancellable *cancellable)
+g_tls_output_stream_pollable_create_source (GPollableOutputStream *pollable,
+ GCancellable *cancellable)
{
- GTlsOutputStreamBase *tls_stream = G_TLS_OUTPUT_STREAM_BASE (pollable);
+ GTlsOutputStream *tls_stream = G_TLS_OUTPUT_STREAM (pollable);
GTlsConnectionBase *conn;
GSource *ret;
@@ -119,12 +119,12 @@ g_tls_output_stream_base_pollable_create_source (GPollableOutputStream *pollable
}
static gssize
-g_tls_output_stream_base_pollable_write_nonblocking (GPollableOutputStream *pollable,
- const void *buffer,
- gsize size,
- GError **error)
+g_tls_output_stream_pollable_write_nonblocking (GPollableOutputStream *pollable,
+ const void *buffer,
+ gsize size,
+ GError **error)
{
- GTlsOutputStreamBase *tls_stream = G_TLS_OUTPUT_STREAM_BASE (pollable);
+ GTlsOutputStream *tls_stream = G_TLS_OUTPUT_STREAM (pollable);
GTlsConnectionBase *conn;
gssize ret;
@@ -139,11 +139,11 @@ g_tls_output_stream_base_pollable_write_nonblocking (GPollableOutputStream *pol
}
static gboolean
-g_tls_output_stream_base_close (GOutputStream *stream,
- GCancellable *cancellable,
- GError **error)
+g_tls_output_stream_close (GOutputStream *stream,
+ GCancellable *cancellable,
+ GError **error)
{
- GTlsOutputStreamBase *tls_stream = G_TLS_OUTPUT_STREAM_BASE (stream);
+ GTlsOutputStream *tls_stream = G_TLS_OUTPUT_STREAM (stream);
GIOStream *conn;
gboolean ret;
@@ -173,7 +173,7 @@ close_thread (GTask *task,
gpointer task_data,
GCancellable *cancellable)
{
- GTlsOutputStreamBase *tls_stream = object;
+ GTlsOutputStream *tls_stream = object;
GError *error = NULL;
GIOStream *conn;
@@ -193,70 +193,69 @@ close_thread (GTask *task,
static void
-g_tls_output_stream_base_close_async (GOutputStream *stream,
- int io_priority,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+g_tls_output_stream_close_async (GOutputStream *stream,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
GTask *task;
task = g_task_new (stream, cancellable, callback, user_data);
- g_task_set_source_tag (task, g_tls_output_stream_base_close_async);
+ g_task_set_source_tag (task, g_tls_output_stream_close_async);
g_task_set_priority (task, io_priority);
g_task_run_in_thread (task, close_thread);
g_object_unref (task);
}
static gboolean
-g_tls_output_stream_base_close_finish (GOutputStream *stream,
- GAsyncResult *result,
- GError **error)
+g_tls_output_stream_close_finish (GOutputStream *stream,
+ GAsyncResult *result,
+ GError **error)
{
g_return_val_if_fail (g_task_is_valid (result, stream), FALSE);
- g_return_val_if_fail (g_task_get_source_tag (G_TASK (result)) ==
- g_tls_output_stream_base_close_async, FALSE);
+ g_return_val_if_fail (g_task_get_source_tag (G_TASK (result)) == g_tls_output_stream_close_async, FALSE);
return g_task_propagate_boolean (G_TASK (result), error);
}
static void
-g_tls_output_stream_base_class_init (GTlsOutputStreamBaseClass *klass)
+g_tls_output_stream_class_init (GTlsOutputStreamClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GOutputStreamClass *output_stream_class = G_OUTPUT_STREAM_CLASS (klass);
- g_type_class_add_private (klass, sizeof (GTlsOutputStreamBasePrivate));
+ g_type_class_add_private (klass, sizeof (GTlsOutputStreamPrivate));
- gobject_class->dispose = g_tls_output_stream_base_dispose;
- gobject_class->finalize = g_tls_output_stream_base_finalize;
+ gobject_class->dispose = g_tls_output_stream_dispose;
+ gobject_class->finalize = g_tls_output_stream_finalize;
- output_stream_class->write_fn = g_tls_output_stream_base_write;
- output_stream_class->close_fn = g_tls_output_stream_base_close;
- output_stream_class->close_async = g_tls_output_stream_base_close_async;
- output_stream_class->close_finish = g_tls_output_stream_base_close_finish;
+ output_stream_class->write_fn = g_tls_output_stream_write;
+ output_stream_class->close_fn = g_tls_output_stream_close;
+ output_stream_class->close_async = g_tls_output_stream_close_async;
+ output_stream_class->close_finish = g_tls_output_stream_close_finish;
}
static void
-g_tls_output_stream_base_pollable_iface_init (GPollableOutputStreamInterface *iface)
+g_tls_output_stream_pollable_iface_init (GPollableOutputStreamInterface *iface)
{
- iface->is_writable = g_tls_output_stream_base_pollable_is_writable;
- iface->create_source = g_tls_output_stream_base_pollable_create_source;
- iface->write_nonblocking = g_tls_output_stream_base_pollable_write_nonblocking;
+ iface->is_writable = g_tls_output_stream_pollable_is_writable;
+ iface->create_source = g_tls_output_stream_pollable_create_source;
+ iface->write_nonblocking = g_tls_output_stream_pollable_write_nonblocking;
}
static void
-g_tls_output_stream_base_init (GTlsOutputStreamBase *stream)
+g_tls_output_stream_init (GTlsOutputStream *stream)
{
- stream->priv = G_TYPE_INSTANCE_GET_PRIVATE (stream, G_TYPE_TLS_OUTPUT_STREAM_BASE,
GTlsOutputStreamBasePrivate);
+ stream->priv = G_TYPE_INSTANCE_GET_PRIVATE (stream, G_TYPE_TLS_OUTPUT_STREAM, GTlsOutputStreamPrivate);
}
GOutputStream *
-g_tls_output_stream_base_new (GTlsConnectionBase *conn)
+g_tls_output_stream_new (GTlsConnectionBase *conn)
{
- GTlsOutputStreamBase *tls_stream;
+ GTlsOutputStream *tls_stream;
- tls_stream = g_object_new (G_TYPE_TLS_OUTPUT_STREAM_BASE, NULL);
+ tls_stream = g_object_new (G_TYPE_TLS_OUTPUT_STREAM, NULL);
g_weak_ref_init (&tls_stream->priv->weak_conn, conn);
return G_OUTPUT_STREAM (tls_stream);
diff --git a/tls/base/gtlsoutputstream.h b/tls/base/gtlsoutputstream.h
new file mode 100644
index 0000000..3b410d7
--- /dev/null
+++ b/tls/base/gtlsoutputstream.h
@@ -0,0 +1,60 @@
+/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/*
+ * GIO - GLib Input, Output and Streaming Library
+ *
+ * Copyright 2010 Red Hat, Inc
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this library; if not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * In addition, when the library is used with OpenSSL, a special
+ * exception applies. Refer to the LICENSE_EXCEPTION file for details.
+ */
+
+#ifndef __G_TLS_OUTPUT_STREAM_H__
+#define __G_TLS_OUTPUT_STREAM_H__
+
+#include <gio/gio.h>
+#include "gtlsconnection-base.h"
+
+G_BEGIN_DECLS
+
+#define G_TYPE_TLS_OUTPUT_STREAM (g_tls_output_stream_get_type ())
+#define G_TLS_OUTPUT_STREAM(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), G_TYPE_TLS_OUTPUT_STREAM,
GTlsOutputStream))
+#define G_TLS_OUTPUT_STREAM_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), G_TYPE_TLS_OUTPUT_STREAM,
GTlsOutputStreamClass))
+#define G_IS_TLS_OUTPUT_STREAM(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), G_TYPE_TLS_OUTPUT_STREAM))
+#define G_IS_TLS_OUTPUT_STREAM_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), G_TYPE_TLS_OUTPUT_STREAM))
+#define G_TLS_OUTPUT_STREAM_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), G_TYPE_TLS_OUTPUT_STREAM,
GTlsOutputStreamClass))
+
+typedef struct _GTlsOutputStreamPrivate GTlsOutputStreamPrivate;
+typedef struct _GTlsOutputStreamClass GTlsOutputStreamClass;
+typedef struct _GTlsOutputStream GTlsOutputStream;
+
+struct _GTlsOutputStreamClass
+{
+ GOutputStreamClass parent_class;
+};
+
+struct _GTlsOutputStream
+{
+ GOutputStream parent_instance;
+ GTlsOutputStreamPrivate *priv;
+};
+
+GType g_tls_output_stream_get_type (void) G_GNUC_CONST;
+GOutputStream *g_tls_output_stream_new (GTlsConnectionBase *conn);
+
+G_END_DECLS
+
+#endif /* __G_TLS_OUTPUT_STREAM_BASE_H___ */
diff --git a/tls/base/meson.build b/tls/base/meson.build
index f1b2db5..0fac433 100644
--- a/tls/base/meson.build
+++ b/tls/base/meson.build
@@ -1,7 +1,7 @@
tlsbase_sources = files(
'gtlsconnection-base.c',
- 'gtlsinputstream-base.c',
- 'gtlsoutputstream-base.c',
+ 'gtlsinputstream.c',
+ 'gtlsoutputstream.c',
)
tlsbase = static_library('tlsbase',
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]