/simpletypesystem/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/simpletypesystem/trunk
77 by Gustav Hartvigsson
* More work on SStream... Requiers Mutex suppert :-)
1
#include "Stream.h"
2
#include "StreamPrivate.h"
3
4
schar *
5
_s_stream_method_to_string (SStream * self);
6
7
SStream *
8
s_stream_new () {
9
  SStream * self = malloc (sizeof (SStream));
10
  SStreamClass * klass = malloc (sizeof (SStreamClass));
11
  self->priv = malloc (sizeof (SStreamPrivate));
12
  
13
  s_object_set_class (S_OBJECT (self), S_OBJECT_CLASS (klass));
14
  s_object_set_to_string_method (S_OBJECT (self),
15
                                 TO_STRING_FUNC (_s_stream_method_to_string));
16
  
17
  
18
  return self;
19
}
20
21
size_t
22
s_stream_get_beffered (SStream * self) {
23
  return self->priv->buffered;
24
}
25
26
schar *
27
_s_stream_method_to_string (SStream * self) {
28
  return s_string_new_fmt ("(SStream: refcount: %d, buffered: %d)",
29
                           s_object_get_refcount (S_OBJECT (self)),
30
                           s_stream_get_beffered (self));
31
}
32