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


unsigned long MLNewParameters(char* p, unsigned long rev, unsigned long apirev)
initializes an MLParameters object p and sets the MathLink revision number to the value specified by rev, and the MathLink API revision number to the value specified by apirev.
  • The MathLink revision number and the MathLink API revision number should be set to the the constants MLREVISION and MLAPIREVISION from mathlink.h.
  • MLNewParameters() does not allocate memory for the MLParameters object p.
  • MLNewParameters() returns rev on success or 0 if an error occurs.
  • MLNewParameters() is declared in the MathLink header file mathlink.h.
#include <stdlib.h>
#include "mathlink.h"

/* initialize the MathLink environment */

MLENV f(void)
    MLENV env;
    MLParameters p;
    unsigned long res;

    if(! MLNewParameters((char *)p, MLREVISION, MLAPIREVISION))
        { /* unable to initialize the parameters object */ }

    MLSetAllocParameter((char *)p, malloc, free);

    env = MLInitialize((char *)p);
    if(env (MLENV)0)
        { /* unable to initialize the MathLink environment */ }

    return env;