MLPutUCS2Function (C Function)

MLPutUCS2Function has been replaced by WSPutUCS2Function.

int MLPutUCS2Function(( MLINK l , const unsigned short * s , int v , int n )

puts a function with head given by a UCS2 encoded symbol with name s of length v and with n arguments to the MathLink connection specified by l.

Details

  • After the call to MLPutUCS2Function(), other MathLink functions must be called to send the arguments of the function.
  • MLPutUCS2Function() returns 0 in the event of an error, and a nonzero value if the function succeeds.
  • Use MLError() to retrieve the error code if MLPutUCS2Function() fails.
  • MLPutUCS2Function() is declared in the MathLink header file mathlink.h.

Examples

Basic Examples  (1)

#include "mathlink.h"

/* A function to put a List[1,2,3] to the link */

void f(MLINK l)
{
    unsigned short name[4];

    name[0] = 'L';
    name[1] = 'i';
    name[2] = 's';
    name[3] = 't';

    if(! MLPutUCS2Function(l, (unsigned short *)name, 4, 3))
    { /* Unable to put the function to the link */ }

    if(! MLPutInteger8(l, 1))
    { /* Unable to put 1 to the link */ }

    if(! MLPutInteger8(l, 2))
    { /* Unable to put 2 to the link */ }

    if(! MLPutInteger8(l, 3))
    { /* Unable to put 3 to the link */ }

    if(! MLEndPacket(l))
    { /* Unable to send the end-of-packet sequence to the link */ }

    if(! MLFlush(l))
    { /* Unable to flush any buffered output data in the link */ }
}