![]() |
![]() |
![]() |
CTPL Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#include <ctpl/output-stream.h> typedef CtplOutputStream; #define ctpl_output_stream_new #define ctpl_output_stream_ref #define ctpl_output_stream_unref gboolean ctpl_output_stream_write (CtplOutputStream *stream
,const gchar *data
,gssize length
,GError **error
); gboolean ctpl_output_stream_put_c (CtplOutputStream *stream
,gchar c
,GError **error
);
The data output stream used by CTPL; built on top of GOutputStream.
A CtplOutputStream is created with ctpl_output_stream_new()
. It uses a
GObject-like refcounting, through ctpl_output_stream_ref()
and
ctpl_output_stream_unref()
.
typedef GOutputStream CtplOutputStream;
An opaque object representing an output data stream.
#define ctpl_output_stream_new g_object_ref
Creates a new CtplOutputStream for a given GOutputStream. This function adds a reference to the GOutputStream.
|
A GOutputStream |
Returns : |
A new CtplOutputStream. |
Since 0.2
#define ctpl_output_stream_ref g_object_ref
Adds a reference to a CtplOutputStream.
|
A CtplOutputStream |
Returns : |
The stream |
Since 0.2
#define ctpl_output_stream_unref g_object_unref
Removes a reference from a CtplOutputStream. When its reference count reaches 0, the stream is destroyed.
|
A CtplOutputStream |
Since 0.2
gboolean ctpl_output_stream_write (CtplOutputStream *stream
,const gchar *data
,gssize length
,GError **error
);
Writes a buffer to a CtplOutputStream.
|
A CtplOutputStream |
|
The data to write |
|
Length of the data in bytes, or -1 if it is a 0-terminated string |
|
Return location for errors, or NULL to ignore them |
Returns : |
TRUE on success, FALSE otherwise. |
Since 0.2
gboolean ctpl_output_stream_put_c (CtplOutputStream *stream
,gchar c
,GError **error
);
Writes a character to a CtplOutputStream.
|
A CtplOutputStream |
|
The character to write |
|
Return location for errors, or NULL to ignore them |
Returns : |
TRUE on success, FALSE otherwise. |
Since 0.2