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

WSLINK WSDuplicateLink(WSLINK parent,const char *name,int *err)
returns a copy of parent and sets the new link object's name to name.

DetailsDetails

  • The newly created link has an exact copy of the incoming and outgoing data streams of the parent link.
  • WSDuplicateLink() does not copy user data blocks.
  • Upon successful completion, WSDuplicateLink() returns a new link object and sets err to WSEOK.
  • In the event of an error, WSDuplicateLink() returns (WSLINK)0 and sets err to the appropriate value.
  • WSDuplicateLink() is declared in the WSTP header file wstp.h.

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

#include "wstp.h"

/* make a copy of a link */

MLINK f(MLINK lp)
{
    MLINK newlink;
    int error;

    newlink = WSDuplicateLink(lp, (const char *)"Duplicate 1", &error);
    if(newlink == (MLINK)0 || error != MLEOK)
        { /* unable to create a copy of the link */ }

    return newlink;
}