OpenersNotesSection(Spacer1)Details

WSAllocParameter() returns error codes using the standard error values as returned by (NonWLLink[WSError(), paclet:ref/c/WSError]).

On success WSAllocParameter() returns WSEOK.

(NonWLLink[WSEnvironmentParameter, paclet:ref/c/WSEnvironmentParameter]) objects are used to control runtime characteristics of a WSTP environment.

WSAllocParameter() 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"

/* retrieves the memory allocator and deallocator function pointers  
   from WSParameters */

void f(WSEnvironmentParameter p)
{
	WSAllocator a;
	WSDeallocator d;
	int result;

	result = WSAllocParameter(p, &a, &d);
	if(result != WSEOK)
		{ /* unable to retrieve the memory allocator pointers */ }

	/* ... */
}

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

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(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])}})}})