Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > MathLink C Language Functions >
MathLink C Function

MLClose()

void MLClose(MLINK link)
closes a MathLink connection.
  • Calling MLClose() does not necessarily terminate a program at the other end of the link.
  • Any data buffered in the link is sent when MLClose() is called.
  • Programs should close all links they have opened before terminating.
  • MLClose() is declared in the MathLink header file mathlink.h.
#include "mathlink.h"

int main(int argc, char **argv)
{
    MLENV ep;
    MLINK lp;
    int error;

    ep = MLInitialize((MLParametersPointer)0);
    if(ep (MLENV)0)
        { /* environment initialization failed */ }

    lp = MLOpenArgv(ep, argv, argv + argc, &error);
    if(lp (MLINK)0 || error MLEOK)
        { /* link creation failed */ }

    ...

    MLClose(lp);
    MLDeinitialize(ep);

    return 0;
}
© 2013 Wolfram Research, Inc. Japanese
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team