Sybase Technical Library - Product Manuals Home
[Search Forms] [Previous Section with Hits] [Next Section with Hits] [Clear Search] Expand Search

Client message callbacks [Table of Contents] Client message callback example

Open Client Client-Library/C Reference Manual

[-] Chapter 2 Topics
[-] Callbacks
[-] Client message callbacks
[-] Defining a client message callback

Defining a client message callback

A client message callback is defined as follows:

CS_RETCODE CS_PUBLIC 
 clientmsg_cb(context, connection, message)
CS_CONTEXT           *context;
 CS_CONNECTION   *connection;
 CS_CLIENTMSG       *message;

where:

A client message callback must return either CS_SUCCEED or CS_FAIL:

Table 2-3 lists the Client-Library routines that a client message callback can call:

Routines that a client-message 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 or to set the CS_USERDATA property only

ct_cancel (CS_CANCEL_ATTN)

Any circumstances

Most applications use a client message callback that simply displays the error details or logs them to a file. However, some applications may require a callback that recognizes certain errors and takes specific action. See "Handling specific Client-Library messages" for more information on how this is done.


Client message callbacks [Table of Contents] Client message callback example