/simpletypesystem/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/simpletypesystem/trunk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "Stream.h"
#include "StreamPrivate.h"

schar *
_s_stream_method_to_string (SStream * self);

SStream *
s_stream_new () {
  SStream * self = malloc (sizeof (SStream));
  SStreamClass * klass = malloc (sizeof (SStreamClass));
  self->priv = malloc (sizeof (SStreamPrivate));
  
  s_object_set_class (S_OBJECT (self), S_OBJECT_CLASS (klass));
  s_object_set_to_string_method (S_OBJECT (self),
                                 TO_STRING_FUNC (_s_stream_method_to_string));
  
  
  return self;
}

size_t
s_stream_get_beffered (SStream * self) {
  return self->priv->buffered;
}

schar *
_s_stream_method_to_string (SStream * self) {
  return s_string_new_fmt ("(SStream: refcount: %d, buffered: %d)",
                           s_object_get_refcount (S_OBJECT (self)),
                           s_stream_get_beffered (self));
}