This is documentation for Mathematica 6, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
MathLink C Function

MLReleaseEnvIDString()

void MLReleaseEnvIDString(MLINK link, const char *s)
disowns the memory allocated by MLGetLinkedEnvIDString() to store the identification string s.
  • 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.
#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;
}