({{, wsprep options template.tm
preprocesses the WSTP template file template.tm, and generates C code that contains all the necessary WSTP code to call C functions from the Wolfram Language.}})

OpenersNotesSection(Spacer1)Details

wsprep processes .tm template files that describe interfaces between Wolfram Language functions and C functions. These interfaces allow the Wolfram Language to call the C functions from within the Wolfram System runtime.

wsprep generates the necessary set of C WSTP API function calls to communicate with the Wolfram Language kernel automatically. Users can take the C code generated by wsprep, compile it and link it with the rest of their C program. The resulting program is suitable for use with (RefLink[Install, paclet:ref/Install]).

wsprep supports the following command-line options:

With -lines, entries from the template files will be preceded by # line line-number "sourcefile".

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {Related Programs:  (RefLink[wscc, paclet:ref/program/wscc])}, {Related System Files:  (RefLink[file.tm, paclet:ref/file/file.tm])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Setting Up External Functions to Be Called from the Wolfram Language, paclet:tutorial/SettingUpExternalFunctionsToBeCalledFromTheWolframLanguage])}, {▪(RefLinkPlain[WSTP and External Program Communication, paclet:tutorial/WSTPAndExternalProgramCommunicationOverview])}, {▪(RefLinkPlain[WSTP Developer Guide (Windows), paclet:tutorial/WSTPDeveloperGuide-WindowsOverview])}, {▪(RefLinkPlain[WSTP Developer Guide (Mac), paclet:tutorial/WSTPDeveloperGuide-MacintoshOverview])}, {▪(RefLinkPlain[WSTP Developer Guide (Linux), paclet:tutorial/WSTPDeveloperGuide-UnixOverview])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Calling External Programs, paclet:guide/CallingExternalPrograms])}, {▪(RefLinkPlain[C/C++ Language Interface, paclet:guide/CLanguageInterface])}, {▪(RefLinkPlain[Installable WSTP Programs, paclet:guide/InstallableWSTPPrograms])}, {▪(RefLinkPlain[WSTP API, paclet:guide/WSTPAPI])}})}})