Name
bonobo-stream-client -- Simplified client wrapper functions for the Stream interface
Synopsis
guint8* bonobo_stream_client_read (const Bonobo_Stream stream,
const size_t size,
CORBA_long *length_read,
CORBA_Environment *ev);
void bonobo_stream_client_write (const Bonobo_Stream stream,
const void *buffer,
const size_t size,
CORBA_Environment *ev);
void bonobo_stream_client_write_string
(const Bonobo_Stream stream,
const char *str,
const gboolean terminate,
CORBA_Environment *ev);
void bonobo_stream_client_printf (const Bonobo_Stream stream,
const gboolean terminate,
CORBA_Environment *ev,
const char *fmt,
...);
CORBA_long bonobo_stream_client_read_string
(const Bonobo_Stream stream,
char **str,
CORBA_Environment *ev);
CORBA_long bonobo_stream_client_get_length (const Bonobo_Stream stream,
CORBA_Environment *ev);
|
Description
These interfaces are designed to make the stream interface
slightly easier to use from client code. This is done 2 ways,
first by make the exception environments optiional, and secondly
by providing slightly nicer semantics.
Example 1. Writing some simple data to a stream
bonobo_stream_client_printf (stream, TRUE, ev, "Hello World: d", 5);
|
It is well worth using the bonobo_stream_client_write function
for any potentialy large writes, since this blocks the data into
sensible chunks. This is important, otherwise a single transfer is
attempted that will cause hassles in the CORBA stubs. [ NB. ORBit
tries to alloca a huge chunk of memory and SEGVs ].
Details
bonobo_stream_client_read ()
guint8* bonobo_stream_client_read (const Bonobo_Stream stream,
const size_t size,
CORBA_long *length_read,
CORBA_Environment *ev); |
This is a helper routine to read size bytes from the stream into
a freshly g_ allocated buffer which is returned. Whilst this
routine may seem pointless; it reads the stream in small chunks
avoiding possibly massive alloca's inside ORBit's stub/skel code.
bonobo_storage_copy_to ()
Implements a pure CORBA method for copying one storage into
another, this is used by several BonoboStorage implemetations
where a fast case localy copy cannot work.
bonobo_storage_write_class_id ()
void bonobo_storage_write_class_id (BonoboStorage *storage,
char *class_id); |
bonobo_stream_write_class_id ()
void bonobo_stream_write_class_id (BonoboStream *stream,
char *class_id); |