#include "mathlink.h"
/* send an Integrate[] expression to a link */
void f(MLINK lp)
{
unsigned char *expr = "Integrate[1/Sin[x],x]";
if(! MLPutFunction(lp, "EvaluatePacket", 1))
{ /* unable to send the function to lp */ }
if(! MLPutFunction(lp, "ToExpression", 1))
{ /* unable to send the function to lp */ }
if(! MLPutUTF8String(lp, (const unsigned char *)expr, 21))
{ /* unable to send the expression to lp */ }
if(! MLEndPacket(lp))
{ /* unable to send the end-of-packet indicator to lp */ }
if(! MLFlush(lp))
{ /* unable to flush any buffered outgoing data to lp */ }
}