WSPutData()
This feature is not supported on the Wolfram Cloud.

int WSPutData(WSLINK link,const char *b,int count)
puts count bytes from the buffer b to the WSTP connection specified by link.

DetailsDetails

  • WSPutData() returns 0 in the event of an error, and a nonzero value if the function succeeds.
  • Use WSError() to retrieve the error code if WSPutData() fails.
  • WSPutData() is declared in the WSTP header file wstp.h.

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

#include <string.h>
#include "wstp.h"

/* send "Hello World!" to a link */

void f(MLINK lp)
{
    if(! WSPutNext(lp, WSTKSTR))
        { /* unable to put type WSTKSTR to lp */ }

    if(! WSPutSize(lp, strlen("Hello World!"))
        { /* unable to put the length of "Hello World!" to lp */ }

    if(! WSPutData(lp, "Hello World!", strlen("Hello World!")))
        { /* unable to put the data "Hello World!" to lp */ }
}