Defining a notification callback

A notification callback is defined as follows:

CS_RETCODE CS_PUBLIC notification_cb(conn, proc_name,
                                     namelen)

CS_CONNECTION     *conn;
CS_CHAR           *proc_name;
CS_INT            namelen;

where:

A notification callback must return CS_SUCCEED.

Table 2-5 lists the Client-Library routines that a notification callback calls:

Table 2-5: Routines that a notification callback can call

Callable routine

Permitted use

ct_config

To retrieve information only.

ct_con_props

To retrieve information or to set the CS_USERDATA property only.

ct_cmd_props

To retrieve information only. The CS_USERDATA property can be set on command structures allocated with ct_cmd_alloc.

NoteThe CS_USERDATA property cannot be set on the command structure obtained by the callback’s ct_con_props(CS_NOTIF_CMD) call.

ct_cancel (CS_CANCEL_ATTN)

Any circumstances.

ct_bind, ct_describe, ct_fetch, ct_get_data, ct_res_info(CS_NUMDATA)

To retrieve the notification parameter values. The routines must be called with the command structure returned by the callback’s ct_con_props(CS_NOTIF_CMD) call.