The file GATECBS.C defines an error handler called chk_err to handle ODS Library errors and server messages. This example shows how to implement the chk_err function and install it using the srv_errhandle function.
int chk_err(
SRV_SERVER * server, // Open Data Services application that got the
// error
SRV_PROC * srvproc, // Error connection being used
int srverror, // Error number
BYTE severity, // Severity of the error
BYTE state, // Error state
int oserrnum, // Operating-system error number
DBHAR * errtext, // Text of the error message
int errtextlen, // Length of the error message
DBHAR * oserrtext, // Pointer to the operating-system
// error message
int oserrtextlen); // Length of the operating-system
// error message
srv_errhandle (chk_err);
server = srv_init(config, RegistryName, SRV_NULLTERM);