Swfdec Reference Manual | ||||
---|---|---|---|---|
#include <swfdec/swfdec.h> SwfdecStream; SwfdecStreamClass; gboolean swfdec_stream_is_open (SwfdecStream *stream); gboolean swfdec_stream_is_complete (SwfdecStream *stream); void swfdec_stream_open (SwfdecStream *stream); void swfdec_stream_push (SwfdecStream *stream, SwfdecBuffer *buffer); void swfdec_stream_close (SwfdecStream *stream); void swfdec_stream_error (SwfdecStream *stream, const char *error, ...); void swfdec_stream_errorv (SwfdecStream *stream, const char *error, va_list args);
SwfdecStream is the base class used for communication inside Swfdec. If you are a UNIX developer, think of this class as the equivalent to a file descriptor. SwfdecLoader and SwfdecSocket are the subclasses supposed to be used for files or network sockets, respectively.
This class provides the functions necessary to implement subclasses of streams. None of the functions described in this section should be used by anything but subclass implementations. Consider them "protected".
typedef struct _SwfdecStream SwfdecStream;
This is the base object used for providing input. It is abstract, use a subclass to provide your input. All members are considered private.
typedef struct { /* get a nice description string */ const char * (* describe) (SwfdecStream * stream); /* close the stream. */ void (* close) (SwfdecStream * stream); } SwfdecStreamClass;
This is the base class used for providing input. You are supposed to create a subclass that fills in the function pointers mentioned above.
|
Provide a string describing your string. Default implementations of this function exist for both the SwfdecLoader and SwfdecStream subclasses. They return the URL for the stream. |
|
Called when Swfdec requests that the stream be closed. After this function was called, Swfdec will consider the stream finished and will not ever read data from it again. |
gboolean swfdec_stream_is_open (SwfdecStream *stream);
Checks if the given stream
is currrently open. Some functions, for example
swfdec_socket_send()
, require an open stream.
|
a SwfdecStream |
Returns : |
TRUE if the stream is open, FALSE otherwise.
|
gboolean swfdec_stream_is_complete (SwfdecStream *stream);
Checks if all data has successfully been transmitted through the stream
and it has been closed.
|
a SwfdecStream |
Returns : |
TRUE if the stream is completed, FALSE otherwise.
|
void swfdec_stream_open (SwfdecStream *stream);
Call this function when your stream opened the resulting file. For HTTP this
is when having received the headers. You must call this function before
swfdec_stream_push()
can be called.
|
a SwfdecStream |
void swfdec_stream_push (SwfdecStream *stream, SwfdecBuffer *buffer);
Makes the data in buffer
available to stream
and processes it. The stream
must be open.
|
a SwfdecStream |
|
new data to make available. The stream takes the reference to the buffer. |
void swfdec_stream_close (SwfdecStream *stream);
Indicates to stream
that no more data will follow. The stream must be open.
|
a SwfdecStream |
void swfdec_stream_error (SwfdecStream *stream, const char *error, ...);
Moves the stream in the error state if it wasn't before. A stream that is in the error state will not process any more data. Also, internal error handling scripts may be executed.
|
a SwfdecStream |
|
a printf-style string describing the error |
|
arguments for the error string
|
void swfdec_stream_errorv (SwfdecStream *stream, const char *error, va_list args);
This function is the va_list alternative to swfdec_stream_error()
. See that
function for details.
|
a SwfdecStream |
|
a printf-style error string |
|
arguments for error
|