MLPutSymbol (C Function)

MLPutSymbol has been replaced by WSPutSymbol.

int MLPutSymbol(MLINK link,const char *s)

puts a symbol whose name is given by the character string s to the MathLink connection specified by link.

Details

  • The character string must be terminated with a null byte, corresponding to 0 in C.
  • MLPutSymbol() returns 0 in the event of an error, and a nonzero value if the function succeeds.
  • Use MLError() to retrieve the error code if MLPutSymbol() fails.
  • MLPutSymbol() is declared in the MathLink header file mathlink.h.

Examples

Basic Examples  (1)

#include "mathlink.h"

/* send the expression Integrate[Sin[x],x] to a link */

void f(MLINK lp)
{
    if(! MLPutFunction(lp, "Integrate", 2))
        { /* unable to put the function to lp */ }

    if(! MLPutFunction(lp, "Sin", 1))
        { /* unable to put the function to lp */ }

    if(! MLPutSymbol(lp, "x"))
        { /* unable to put the symbol to lp */ }

    if(! MLPutSymbol(lp, "x"))
        { /* unable to put the symbol to lp */ }

    if(! MLEndPacket(lp))
        { /* unable to send the end-of-packet indicator to lp */ }

    if(! MLFlush(lp))
        { /* unable to flush any outgoing data buffered in lp */ }
}