Deallocates a CS_CONTEXT structure.
CS_RETCODE cs_ctx_drop(context) CS_CONTEXT *context;
A pointer to a CS_CONTEXT structure.
cs_cxt_drop returns:
Returns |
Indicates |
---|---|
CS_SUCCEED |
The routine completed successfully. |
CS_FAIL |
The routine failed. |
cs_ctx_drop returns CS_FAIL if the context contains an open connection.
/*
** ex_ctx_cleanup()
**
** Parameters:
** context Pointer to context structure.
** status Status of last interaction with Client-
** Library. If not ok, this routine will perform
** a force exit.
**
** Returns:
** Result of function calls from Client-Library.
*/
CS_RETCODE CS_PUBLIC
ex_ctx_cleanup(context, status)
CS_CONTEXT *context;
CS_RETCODE status;
{
CS_RETCODE retcode;
CS_INT exit_option;
exit_option = (status != CS_SUCCEED) ? CS_FORCE_EXIT :
CS_UNUSED;
retcode = ct_exit(context, exit_option);
if (retcode != CS_SUCCEED)
{
ex_error("ex_ctx_cleanup: ct_exit() failed");
return retcode;
}
retcode = cs_ctx_drop(context);
if (retcode != CS_SUCCEED)
{
ex_error("ex_ctx_cleanup: cs_ctx_drop() failed");
return retcode;
}
return retcode;
}
A CS_CONTEXT structure describes a particular context, or operating environment, for a set of server connections.
Once a CS_CONTEXT has been deallocated, it cannot be used again. To allocate a new CS_CONTEXT, an application can call cs_ctx_alloc.
Sybase supports only one context handler per application
program.
A Client-Library application cannot call cs_ctx_drop to deallocate a CS_CONTEXT structure until it has called ct_exit to clean up Client-Library space associated with the context.
cs_ctx_alloc, ct_close, ct_exit