CHM_MANAGE(3)

FUNCTION
chm_manage - Manage a channel for activity by registering callback routines.

SYNOPSIS
#include <karma_chm.h>

KManagedChannel chm_manage

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

DESCRIPTION
Manage a channel for activity by registering callback routines.

channel
    The channel object to manage.

info
    The arbitrary information pointer associated with the managed channel. This pointer may be modified by the callback routines.

input_func
    This routine is called when new input occurs on the channel. If this is NULL, no callback routine is installed. The prototype function is <-chm_PROTO_input_func->.

close_func
    This routine is called when the channel closes. If this is NULL, no callback routine is installed. The prototype function is <-chm_PROTO_close_func->. The channel object MUST be capable of detecting closure if this routine is supplied (i.e. this routine cannot be supplied for dock channels). Any unread buffered data in the channel will be lost upon closure. The call to this function is the last chance to read this buffered data.

output_func
    This routine is called when the channel becomes ready for output. If this is NULL, no callback routine is installed. The prototype function is <-chm_PROTO_output_func->.

exception_func
    This routine is called when exceptions occur on the channel. If this is NULL, no callback routine is installed. The prototype function is <-chm_PROTO_exception_func->.

RETURN VALUE
A KManagedChannel object on success, else NULL.

Multi-threading Level
Unsafe.

AUTHOR
Richard Gooch (rgooch@atnf.csiro.au)

AVAILABLITY
The Karma Distribution is available for anonymous ftp from: ftp://ftp.atnf.csiro.au/pub/software/karma/ ftp://wuarchive.wustl.edu/graphics/graphics/packages/karma/ ftp://ftp.pwr.wroc.pl/pub/karma/ The Karma Home Page is: http://www.atnf.csiro.au/karma/