WSVersionNumbers (C Function)

void WSVersionNumbers(WSENV ep,int *inumb,int *rnumb,int *bnumb)

returns the WSTP API interface number, revision number, and build number and stores them respectively in inumb, rnumb, and bnumb.

Details

  • For computer systems where the WSTP libraries are distributed as dynamic library modules, WSVersionNumbers() allows a runtime inspection of the version information for the WSTP library.
  • WSVersionNumbers() will also function for programs that use the WSTP library statically; however, the function return values will not change.
  • WSVersionNumbers() is declared in the WSTP header file wstp.h.

Examples

Basic Examples  (1)

#include <stdio.h>
#include "wstp.h"

int main()
{
    WSENV env;
    int interface;
    int revision;
    int build;

    env = WSInitialize((WSEnvironmentParameter)0);
    if(env == (WSENV)0)
        { /* unable to initialize the WSTP environment */ }

    WSVersionNumbers(env, &interface, &revision, &build);

    if(!(interface >= 3))
        {
        printf("Incorrect WSTP library available.\n");
        WSDeinitialize(env);
        return 1;
        }

    /* ... */

    WSDeinitialize(env);

    return 0;
}