The "chm" Package

These routines are meant to provide a generic and simple to use channel management facility (i.e. event processing on pipes, connections and terminals). A similar set of routines: chx_ provide identical functionality (with the exception of the polling routine), except that they rely on the Xt Intrinsics event dispatching system.

Library: karma
Link With: -lkarma

Functions

chm_manageManage a channel for activity by registering callback routines.
chm_unmanageTerminate the management of a channel for activity.
chm_pollPoll all managed channels for any activity.

Prototype Functions

CHM_PROTO_input_funcThis routine is called when new input occurs on a channel.
CHM_PROTO_close_funcThis routine is called when a channel closes.
CHM_PROTO_output_funcThis routine is called when a channel becomes ready for writing.
CHM_PROTO_exception_funcThis routine is called when an exception occurs on channel.


Functions


flag chm_manage ( Channel channel, void *info, flag (*input_func) (), void (*close_func) (), flag (*output_func) (), flag (*exception_func) () )

Manage a channel for activity by registering callback routines.

Parameters:

Returns: TRUE on success, else FALSE.
Multithreading Level: Unsafe


void chm_unmanage (Channel channel)

Terminate the management of a channel for activity.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe
Note:


void chm_poll (long timeout_ms)

Poll all managed channels for any activity.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


Prototype Functions


flag CHM_PROTO_input_func (Channel channel, void **info)

This routine is called when new input occurs on a channel.

Parameters:

Returns: TRUE if the channel is to remain managed and open, else FALSE (indicating that the channel is to be unmanaged and closed).
Multithreading Level: Unsafe
Note:


void CHM_PROTO_close_func (Channel channel, void *info)

This routine is called when a channel closes.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe
Note:


flag CHM_PROTO_output_func (Channel channel, void **info)

This routine is called when a channel becomes ready for writing.

Parameters:

Returns: TRUE if the channel is to remain managed and open, else FALSE (indicating that the channel is to be unmanaged and closed).
Multithreading Level: Unsafe
Note:


flag CHM_PROTO_exception_func (Channel channel, void **info)

This routine is called when an exception occurs on channel.

Parameters:

Returns: TRUE if the channel is to remain managed and open, else FALSE (indicating that the channel is to be unmanaged and closed).
Multithreading Level: Unsafe
Note:


Contact: Richard Gooch
Web Development: Ariel Internet Services