srv_version

Description

Define the version of Open Server an application is using.

Syntax

CS_RETCODE srv_version(contextp, version)
CS_CONTEXT       *contextp;
CS_INT                version;

Parameters

contextp

A pointer to a CS_CONTEXT structure, which the application has obtained through a call to cs_ctx_alloc. The CS_CONTEXT structure serves as a server-wide configuration structure shared with client libraries. For more information on the CS_CONTEXT structure, see “CS-Library”.

version

The version of Open Server the application assumes is in effect. Currently, the legal values for this parameter are CS_VERSION_100 and CS_VERSION_110, for Server Library versions 10.0 and 11.1, respectively.

Returns

Table 3-149:  Return values (srv_version)

Returns

To indicate

CS_SUCCEED

The routine completed successfully.

CS_FAIL

The routine failed.

Examples

Example 1

#include <stdio.h>
#include <ospublic.h>
......
/*
 ** This code fragment sets the Open Server version.
 */
main()
 {
CS_CONTEXT *cp;
if (cs_ctx_alloc(CS_VERSION_110, &cp) != CS_SUCCEED)
 {
     fprintf(stderr, “cs_ctx_alloc failed \n”);
      exit(1);
}
if(srv_version(cp, CS_VERSION_110) != CS_SUCCEED)
{
     /*
      ** Release the context structure al&ready allocated.
      */
     (CS_VOID)cs_ctx_drop(cp);
     (CS_VOID)fprintf(stderr, "srv_version failed \n");
       exit(1);
}
......
}

Usage

See also

cs_ctx_alloc, cs_ctx_props