X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;ds=sidebyside;f=gio%2Fgfilteroutputstream.c;h=9089579e335530ab2f48031901934147cbccd0dd;hb=f14a66e3df9e5e3f0f170b68e976011c80ffc041;hp=7755b9e6412ac473278e593b8ba0b91254a40232;hpb=73ca8b47540d005d5227c03aac143d6780da654c;p=platform%2Fupstream%2Fglib.git
diff --git a/gio/gfilteroutputstream.c b/gio/gfilteroutputstream.c
index 7755b9e..9089579 100644
--- a/gio/gfilteroutputstream.c
+++ b/gio/gfilteroutputstream.c
@@ -13,16 +13,13 @@
* 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, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307, USA.
+ * Public License along with this library; if not, see .
*
* Author: Christian Kellner
*/
#include "config.h"
#include "gfilteroutputstream.h"
-#include "gsimpleasyncresult.h"
#include "goutputstream.h"
#include "glibintl.h"
@@ -68,16 +65,13 @@ static gboolean g_filter_output_stream_close (GOutputStream *stream,
GCancellable *cancellable,
GError **error);
-G_DEFINE_ABSTRACT_TYPE (GFilterOutputStream, g_filter_output_stream, G_TYPE_OUTPUT_STREAM)
-
-#define GET_PRIVATE(inst) G_TYPE_INSTANCE_GET_PRIVATE (inst, \
- G_TYPE_FILTER_OUTPUT_STREAM, GFilterOutputStreamPrivate)
-
typedef struct
{
gboolean close_base;
} GFilterOutputStreamPrivate;
+G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GFilterOutputStream, g_filter_output_stream, G_TYPE_OUTPUT_STREAM)
+
static void
g_filter_output_stream_class_init (GFilterOutputStreamClass *klass)
{
@@ -94,8 +88,6 @@ g_filter_output_stream_class_init (GFilterOutputStreamClass *klass)
ostream_class->flush = g_filter_output_stream_flush;
ostream_class->close_fn = g_filter_output_stream_close;
- g_type_class_add_private (klass, sizeof (GFilterOutputStreamPrivate));
-
g_object_class_install_property (object_class,
PROP_BASE_STREAM,
g_param_spec_object ("base-stream",
@@ -151,8 +143,10 @@ g_filter_output_stream_get_property (GObject *object,
GParamSpec *pspec)
{
GFilterOutputStream *filter_stream;
+ GFilterOutputStreamPrivate *priv;
filter_stream = G_FILTER_OUTPUT_STREAM (object);
+ priv = g_filter_output_stream_get_instance_private (filter_stream);
switch (prop_id)
{
@@ -161,7 +155,7 @@ g_filter_output_stream_get_property (GObject *object,
break;
case PROP_CLOSE_BASE:
- g_value_set_boolean (value, GET_PRIVATE (filter_stream)->close_base);
+ g_value_set_boolean (value, priv->close_base);
break;
default:
@@ -216,14 +210,18 @@ g_filter_output_stream_get_base_stream (GFilterOutputStream *stream)
* Returns whether the base stream will be closed when @stream is
* closed.
*
- * Return value: %TRUE if the base stream will be closed.
+ * Returns: %TRUE if the base stream will be closed.
**/
gboolean
g_filter_output_stream_get_close_base_stream (GFilterOutputStream *stream)
{
+ GFilterOutputStreamPrivate *priv;
+
g_return_val_if_fail (G_IS_FILTER_OUTPUT_STREAM (stream), FALSE);
- return GET_PRIVATE (stream)->close_base;
+ priv = g_filter_output_stream_get_instance_private (stream);
+
+ return priv->close_base;
}
/**
@@ -243,7 +241,7 @@ g_filter_output_stream_set_close_base_stream (GFilterOutputStream *stream,
close_base = !!close_base;
- priv = GET_PRIVATE (stream);
+ priv = g_filter_output_stream_get_instance_private (stream);
if (priv->close_base != close_base)
{
@@ -295,14 +293,12 @@ g_filter_output_stream_close (GOutputStream *stream,
GCancellable *cancellable,
GError **error)
{
+ GFilterOutputStream *filter_stream = G_FILTER_OUTPUT_STREAM (stream);
+ GFilterOutputStreamPrivate *priv = g_filter_output_stream_get_instance_private (filter_stream);
gboolean res = TRUE;
- if (GET_PRIVATE (stream)->close_base)
+ if (priv->close_base)
{
- GFilterOutputStream *filter_stream;
-
- filter_stream = G_FILTER_OUTPUT_STREAM (stream);
-
res = g_output_stream_close (filter_stream->base_stream,
cancellable,
error);