MLEnvironmentParameter (C Function)

MLEnvironmentParameter has been replaced by WSEnvironmentParameter.

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

Details

  • The MathLink environment parameter object stores settings used to configure the MathLink environment object.
  • MLEnvironmentParameter is defined in the MathLink header file mathlink.h, which should be included in the source code for any MathLink-compatible program.
  • MLEnvironmentParameter objects are created by the MLNewParameters() function and deallocated by the MLReleaseParameters() function.
  • MLEnvironmentParameters is declared in the MathLink header file mathlink.h.

Examples

Basic Examples  (1)

#include "mathlink.h"


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

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


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

    MLSetAllocParameter(ep, Custom_Allocator, Custom_Deallocator);

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

    MLReleaseParameters(ep);

    /* ... */

    MLDeinitialize(env);

    return 0;
}