WSEnvironmentParameter
This feature is not supported on the Wolfram Cloud.


is a WSTP type representing a WSTP library environment parameter set.

DetailsDetails

  • The WSTP environment parameter object stores settings used to configure the WSTP environment object.
  • WSEnvironmentParameter is defined in the WSTP header file wstp.h, which should be included in the source code for any WSTP-compatible program.
  • WSEnvironmentParameter objects are created by the WSNewParameters() function and deallocated by the WSReleaseParameters() function.
  • WSEnvironmentParameters is declared in the WSTP header file wstp.h.

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

#include "wstp.h"


void * Custom_Allocator(size_t size)
{
    /* ... */
}

void Custom_Deallocator(void *ptr)
{
    /* ... */
}


int main()
{
    WSEnvironmentParameter ep;
    MLENV env;
    
    ep = WSNewParameters(MLREVISION, MLAPIREVISION);
    if(ep == (WSEnvironmentParameter)0)
    { /* Unable to initialize WSEnvironmentParameter object */ }

    WSSetAllocParameter(ep, Custom_Allocator, Custom_Deallocator);

    /* Give the WSTP library the custom memory allocator */
    env = WSInitialize(ep);
    if(env == (MLENV)0)
    { /* Unable to initialize the WSTP environment */ }

    WSReleaseParameters(ep);

    /* ... */

    WSDeinitialize(env);

    return 0;
}