#include "mathlink.h"
int AppYieldFunction(MLINK lp, MLYieldParameters yp)
{
/* ... */
return 0;
}
int main(int argc, char **argv)
{
MLENV env;
MLINK link;
int error;
env = MLInitialize((MLParametersPointer)0);
if(env
(MLENV)0)
{ /* unable to initialize MathLink environment */ }
link = MLOpenArgcArgv(env, argv, argv + argc, &error);
if(link
(MLINK)0 || error
MLEOK)
{ /* unable to create the link */ }
if(! MLSetYieldFunction(link, (MLYieldFunctionObject)AppYieldFunction))
{ /* unable to set the yield function for link */ }
/* ... */
MLClose(link);
MLDeinitialize(env);
return 0;
}