MLReleaseEnvIDString()
This feature is not supported on the Wolfram Cloud.

has been replaced by .

void MLReleaseEnvIDString(MLINK link,const char *s)
disowns the memory allocated by MLGetLinkedEnvIDString() to store the identification string s.

DetailsDetails

  • Sometimes it is useful to identify sides of a MathLink connection prior to setting up packet-based communication. Using MLSetEnvIDString() the developer can give an identification string for a program that will be exchanged every time a link is established with another program. MLGetLinkedEnvIDString() retrieves the other side of the link's name.
  • MLReleaseEnvIDString() is declared in the MathLink header file mathlink.h.

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

#include <string.h>
#include "mathlink.h"

/* read the other side of the link's id string and check that it is "My Remote Program" */

int f(MLINK lp)
{
    int isCorrectProg;
    const char *envid;

    if(! MLGetLinkedEnvIDString(lp, &envid))
        { /* unable to get remote side id from lp */ }

    isCorrectProg = strcmp(envid, "My Remote Program") == 0;

    MLReleaseEnvIDString(lp, envid, length);

    return isCorrectProg;
}