OpenersNotesSection(Spacer1)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 (RefLink[wstp.h, paclet:ref/file/wstp.h]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (1)

OpenersExampleSection0(Spacer1)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;
}

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[WSTP C API Developer Guide (Mac OS X), paclet:tutorial/WSTPDeveloperGuide-MacintoshOverview])}, {▪(RefLinkPlain[WSTP C API Developer Guide (Unix and Linux), paclet:tutorial/WSTPDeveloperGuide-UnixOverview])}, {▪(RefLinkPlain[WSTP C API Developer Guide (Windows), paclet:tutorial/WSTPDeveloperGuide-WindowsOverview])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Alphabetical Listing of WSTP C Functions, paclet:guide/AlphabeticalListingOfWSTPCFunctions])}, {▪(RefLinkPlain[WSTP Connection Management, paclet:guide/WSTPConnectionManagement])}})}})