OpenersNotesSection(Spacer1)Details

WSSeekToMark() returns ((NonWLLink[WSMARK, paclet:ref/c/WSMARK]))0 in the event of an error and mark otherwise.

WSSeekToMark() is declared in the WSTP header file (RefLink[wstp.h, paclet:ref/file/wstp.h]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (1)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

#include "wstp.h"

/* look ahead in the expression stream on a link and reset */

void f(WSLINK lp)
{
	WSMARK mark;
	
	mark = WSCreateMark(lp);
	if(mark == (WSMARK)0)
		{ /* unable to create mark in the stream on lp */ }

	/* now peek ahead and see what is coming */
	switch(WSGetNext(lp))
	{
		case WSTKINT:
			/* integer data */
		case WSTKREAL:
			/* floating-point data */
	}

	/* now restore to the original point */
	mark = WSSeekToMark(lp, mark, 0);
	if(mark == (WSMARK)0)
		{ /* unable to seek to the mark position in lp */ }

	WSDestroyMark(lp, mark);
}

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(NonWLLink[WSCreateMark, paclet:ref/c/WSCreateMark])  ▪  (NonWLLink[WSDestroyMark, paclet:ref/c/WSDestroyMark])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Manipulating Expressions in External Programs, paclet:tutorial/ManipulatingExpressionsInExternalPrograms])}, {▪(RefLinkPlain[WSTP C API Developer Guide (Mac OS X), paclet:tutorial/WSTPDeveloperGuide-MacintoshOverview])}, {▪(RefLinkPlain[WSTP C API Developer Guide (Unix and Linux), paclet:tutorial/WSTPDeveloperGuide-UnixOverview])}, {▪(RefLinkPlain[WSTP C API Developer Guide (Windows), paclet:tutorial/WSTPDeveloperGuide-WindowsOverview])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Alphabetical Listing of WSTP C Functions, paclet:guide/AlphabeticalListingOfWSTPCFunctions])}, {▪(RefLinkPlain[Low-Level WSTP Operations, paclet:guide/LowLevelWSTPOperations])}})}})