Define the version of Open Server an application is using.
CS_RETCODE srv_version(contextp, version)
CS_CONTEXT *contextp; CS_INT version;
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. See “CS-Library”.
The version of Open Server the application assumes is in effect.
Returns  | 
To indicate  | 
|---|---|
CS_SUCCEED  | 
The routine completed successfully.  | 
CS_FAIL  | 
The routine failed.  | 
#include <stdio.h>
#include <ospublic.h>
......
/*
** This code fragment sets the Open Server version.
*/
main()
 {
CS_CONTEXT *cp;
if (cs_ctx_alloc(CS_VERSION_155, &cp) != CS_SUCCEED)
 {
     fprintf(stderr, “cs_ctx_alloc failed \n”);
      exit(1);
}
if(srv_version(cp, CS_VERSION_155) != 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);
}
......
}
An Open Server application must call srv_version prior to calling any other Server-Library routines. It must be preceded by a call to the CS-Library routine cs_ctx_alloc.
Applications can first set localization configuration parameters in the CS_CONTEXT structure, using cs_config.
cs_ctx_alloc, cs_ctx_props