![]() | ![]() |
Home |
|
|
Open Client Client-Library/C Reference Manual |
|
| Chapter 2 Topics |
|
| Callbacks |
|
| Notification callbacks |
|
| 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:
connection is a pointer to the CS_CONNECTION structure receiving the notification. This CS_CONNECTION is the parent connection of the CS_COMMAND that sent the request to be notified.
proc_name is a pointer to the name of the registered procedure that has been executed.
namelen is the length, in bytes, of *proc_name.
A notification callback must return CS_SUCCEED.
Table 2-5 lists the Client-Library routines that a notification callback calls:
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. The 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. |
|
|