WSTP Interface 3

The library now fully supports the Unicode character encoding forms UTF-8, UTF-16, and UTF-32. Use the following new API functions to put or get Unicode characters to or from a link.

The Wolfram Symbolic Transfer Protocol (WSTP) library header file wstp.h no longer contains obsolete platform support sections such as those defined by MACINTOSH_WSTP or OS2_WSTP. MACINTOSH_WSTP definitions referred to Mac OS 9 and earlier. DARWIN_WSTP contains all platform-specific definitions for Mac OS X.

All uses of special alternative names for common C types have been removed from the API. The WSTP header file wstp.h still contains versions of the API functions with these types for use with Interface 2 and older programs.

Previous WSTP typeC type
uchar_ctunsigned char
ucharp_ctunsigned char *
ucharpp_ctunsigned char **
ucharppp_ctunsigned char ***
ushort_ctunsigned short
ushortp_ctunsigned short *
ushortpp_ctunsigned short **
ushortppp_ctunsigned short ***
uint_ctunsigned int
uintp_ctunsigned int *
uintpp_ctunsigned int **
int_ctint
voidp_ctvoid *
voidpp_ctvoid **
charp_ctchar *
charpp_ctchar **
charppp_ctchar ***
long_ctlong
longp_ctlong *
longpp_ctlong **
long_stlong
longp_stlong *
longpp_stlong **
ulong_ctunsigned long
ulongp_ctunsigned long *
kushortp_ctconst unsigned short *
kushortpp_ctconst unsigned short **
kuintp_ctconst unsigned int *
kuintpp_ctconst unsigned int **
kucharp_ctconst unsigned char *
kucharpp_ctconst unsigned char **
kcharp_ctconst char *
kcharpp_ctconst char **
kvoidp_ctconst void *

The memory allocator/deallocator functions passed to the library using WSSetAllocParameter() now must be thread-safe.

API functions that previously took a WSParametersPointer type as an argument or returned a WSParametersPointer type now instead take or return a char * type.

API functions that took as an argument or returned a mlapi_result type now take or return type int.

API functions that took as an argument or returned a mlapi_error type now take or return type int.

API functions that took as an argument or returned a mlapi_token type now take or return type int.

API functions that took as an argument or returned a mlapi_packet type now take or return type int.

API functions that took as an argument or returned a WSPointer type now take or return void *.

The WSOpen* functions previously took type long * for the error variable but now take type int *.

The header file wstp.h now contains several new error definitions related to the Unicode character encoding forms.

Error codeInterpretation
WSEPDATABADWSTP encountered invalid character data in given character encoding
WSEPSCONVERTunable to convert from given character encoding to WSTP encoding
WSEGSCONVERTunable to convert from WSTP encoding to requested character encoding

WSPutMessage() and WSGetMessage() now use types int and int * respectively instead of the dev_message and dev_message * types.

WSSeekMark() and WSSeekToMark() now use type int rather than type long for the expression index.

The functions in the following table took long types for some arguments; they now take int.

WSGetRawData()WSGetData()
WSGetArgCount()WSGetRawArgCount()
WSBytesToGet()WSRawBytesToGet()
WSExpressionsToGet()WSTakeLast()
WSPutRawSize()WSPutRawData()
WSPutArgCount()WSPutComposite()
WSBytesToPut()

WSGetReal() is now an actual API function rather than a #define alias to WSGetDouble(). WSGetReal() still has the same functionality as WSGetDouble().

WSActivate() is now an actual API function rather than a #define alias to WSConnect(). WSActivate() still has the same functionality as WSConnect().

The functions in column one listed below are now obsolete. New programs should use the functions listed in column two for replacement functionality.

WSCheckFunction()WSTestHead()
WSCheckFunctionWithArg()WSTestHead()
WSGetShortInteger()WSGetInteger16()
WSGetInteger()WSGetInteger32()
WSGetLongInteger()WSGetInteger64() for 64-bit integers or WSGetInteger32() for 32-bit integers
WSGetFloat()WSGetReal32()
WSGetDouble()WSGetReal64()
WSGetLongDouble()WSGetReal128()
WSGetShortIntegerArrayData()WSGetInteger16ArrayData()
WSGetIntegerArrayData()WSGetInteger32ArrayData()
WSGetLongIntegerArrayData()WSGetInteger64ArrayData() for 64-bit integers or WSGetInteger32ArrayData() for 32-bit integers
WSGetFloatArrayData()WSGetReal32ArrayData()
WSGetDoubleArrayData()WSGetReal64ArrayData()
WSGetLongDoubleArrayData()WSGetReal128ArrayData()
WSGetShortIntegerArray()WSGetInteger16Array()
WSGetIntegerArray()WSGetInteger32Array()
WSGetLongIntegerArray()WSGetInteger64Array() for 64-bit integers or WSGetInteger32Array() for 32-bit integers
WSGetFloatArray()WSGetReal32Array()
WSGetDoubleArray()WSGetReal64Array()
WSGetLongDoubleArray()WSGetReal128Array()
WSDisownShortIntegerArray()WSReleaseInteger16Array()
WSDisownIntegerArray()WSReleaseInteger32Array()
WSDisownLongIntegerArray()WSReleaseInteger64Array() for 64-bit integers or WSReleaseInteger32Array() for 32-bit integers
WSDisownFloatArray()WSReleaseReal32Array()
WSDisownDoubleArray()WSReleaseReal64Array()
WSDisownLongDoubleArray()WSReleaseReal128Array()
WSGetIntegerList()WSGetInteger32List(()
WSGetRealList()WSGetReal64List()
WSDisownIntegerList()WSReleaseInteger32List()
WSDisownRealList()WSReleaseReal64List()
WSPutShortInteger()WSPutInteger16()
WSPutInteger()WSPutInteger32()
WSPutLongInteger()WSPutInteger64() for 64-bit integers or WSPutInteger32() for 32-bit integers
WSPutFloat()WSPutReal32()
WSPutDouble()WSPutReal64()
WSPutLongDouble()WSPutReal128()
WSPutShortIntegerArrayData()WSPutInteger16ArrayData()
WSPutIntegerArrayData()WSPutInteger32ArrayData()
WSPutLongIntegerArrayData()WSPutInteger64ArrayData() for 64-bit integers or WSPutInteger32ArrayData() for 32-bit integers
WSPutFloatArrayData()WSPutReal32ArrayData()
WSPutDoubleArrayData()WSPutReal64ArrayData()
WSPutLongDoubleArrayData()WSPutReal128ArrayData()
WSPutShortIntegerArray()WSPutInteger16Array()
WSPutIntegerArray()WSPutInteger32Array()
WSPutLongIntegerArray()WSPutInteger64Array() for 64-bit integers or WSPutInteger32Array() for 32-bit integers
WSPutFloatArray()WSPutReal32Array()
WSPutDoubleArray()WSPutReal64Array()
WSPutLongDoubleArray()WSPutReal128Array()
WSPutIntegerList()WSPutInteger32List()
WSPutRealList()WSPutReal64List()
WSGetUnicodeString()WSGetUCS2String()
WSGetUnicodeSymbol()WSGetUCS2Symbol()
WSPutUnicodeString()WSPutUCS2String()
WSPutUnicodeSymbol()WSPutUCS2Symbol()
WSPut16BitCharacters()WSPutUCS2Characters()
WSDisownUnicodeString()WSReleaseUCS2String()
WSDisownUnicodeSymbol()WSReleaseUCS2Symbol()

Interface 3 changes the default link protocol for link mode Listen and link mode Connect links. By default the WSTP library will create "SharedMemory" links for link mode Listen and link mode Connect links on all platforms.