/* check a link for a function and return the number of arguments */
int f(MLINK lp) { int a;
switch(MLGetType(lp)) { case MLTKFUNC: /* get the argument size */ if(! MLGetArgCount(lp, &a)) { /* unable to get the number of arguments from lp */ } return a; default: /* ... */ }