jMax documentation
Main Page   Modules   File List  

byte stream i/o

Byte stream i/o classes listening or sending data to a byte stream. More...

Refering to a byte stream

Functions for objects refering to byte stream as input (listeners) or output.

Byte stream listeners

Output functions

Typedefs


Detailed Description

Byte stream i/o classes listening or sending data to a byte stream.

The API documented by this module permits to implement objects refering to byte streams. These objects can receive data from the bytestream and send data to the byte stream.

An i/o object can check if a given object implements an FTS byte stream and whether it is an input and/or an output using the functions fts_bytestream_check(), fts_bytestream_is_input() and fts_bytestream_is_output(). The API provides functions for declaring an object as a listener to a byte stream (see fts_bytestream_add_listener()) and output functions sending events to a byte stream (see fts_bytestream_output()).


Function Documentation

void fts_bytestream_add_listener ( fts_bytestream_t * stream,
fts_object_t * obj,
fts_bytestream_callback_t fun )
 

Register listener to a byte stream.

In order to receive incoming data from a byte stream, an FTS object registers itself as a listener to the byte stream.

Parameters:
stream   the listened byte stream
obj   the listening object
fun   listener function to be called for incoming data
See also:
fts_bytestream_remove_listener()

int fts_bytestream_check ( fts_object_t * obj )
 

Check whether an FTS object implements the byte stream abstraction.

An object who wants to listen to or output via a byte stream should check if the object it referes to implements the byte stream abstraction

Parameters:
obj   the object to be checked
Returns:
non-zero if object implements an FTS byte stream

void fts_bytestream_flush ( fts_bytestream_t * stream )
 

Flush byte streams output buffer (if any).

Parameters:
stream   the byte stream
See also:
fts_bytestream_output , fts_bytestream_output_char

int fts_bytestream_is_input ( fts_bytestream_t * stream )
 

Check whether an FTS byte stream is an input.

Parameters:
stream   the byte stream to be checked
Returns:
non-zero if stream is input

int fts_bytestream_is_output ( fts_bytestream_t * stream )
 

Check whether an FTS byte stream is an input.

Parameters:
stream   the byte stream to be checked
Returns:
non-zero if stream is input

void fts_bytestream_output ( fts_bytestream_t * stream,
int n,
const unsigned char * c )
 

Send a string to a byte stream.

Parameters:
stream   the byte stream
n   the number of characters
c   the characters
See also:
fts_bytestream_output_char , fts_bytestream_flush

void fts_bytestream_output_char ( fts_bytestream_t * stream,
unsigned char c )
 

Send a single character to a byte stream.

Parameters:
stream   the byte stream
c   the character
See also:
fts_bytestream_output , fts_bytestream_flush

void fts_bytestream_remove_listener ( fts_bytestream_t * stream,
fts_object_t * obj )
 

Remove listener from a byte stream.

An object listening to a byte stream must be removed as listener before being destroyed. Typically this is done in the object's delete method.

Parameters:
stream   the listened byte stream
obj   the listening object


jMax server kernel documentation (FTS 2.5)
Generated 4 Jul 2001 Wed Jul 4 13:07:06 2001 by Doxygen 1.2.3 written by Dimitri van Heesch.