wstp.h

wstp.h

WSTP header file.

Details

  • WSTP C functions are declared in the file wstp.h, which should be included in the source code for any WSTPcompatible program.
  • The following special types are defined in wstp.h:
  • WSLINKa WSTP link object (analogous to LinkObject in the Wolfram Language)
    WSMARKa mark in a WSTP stream
    WSENVWSTP library environment
  • The following constants are set up when a WSTP template file is processed:
  • WSLINK stdlinkthe standard link that connects a program built from WSTP templates to the Wolfram System
    WSLINK stdenvthe standard WSTP environment in a program built from WSTP templates
  • All functions defined in wstp.h are C language functions. They can be called from other languages with appropriate wrappers.
  • All functions defined in wstp.h which return int yield a nonzero value if they succeed; otherwise they return 0 and have no effect.
  • In a program set up using WSTP templates (.tm files), the link to the Wolfram System is called stdlink.
  • All functions defined in wstp.h which put data to a link do not deallocate memory used to store the data. Functions which get data from a link may allocate memory to store the data. Functions which get data from a link will not return until the necessary data becomes available. A yield function can be registered to be called during the wait.