Basic Functions

General functionality to help with getting started or using the library.

Functions:

MTK_API_InitExtend

int MTK_API_InitExtend();
		

Description

Initialises the API using the Extend license. This or MTK_API_Init must be run first to initialise the API.

Also refer to MTK_SetVulcanEnvironmentVariable which must be set before running this.

This style of API licensing is only available when Vulcan is installed on the target machine and of version 12.0.3 or above.

Parameters

None

Return Value

0

success

other

failure

MTK_SetVulcanEnvironmentVariable

int MTK_SetVulcanEnvironmentVariable(const char* vulcan);
		

Description

Sets the value of the environment variable 'VULCAN' for this process.

This should be set as the root directory of the Vulcan installation (e.g. "C:/Program Files/Maptek/Vulcan 12.0.3") and is necessary for Extend based licensing.

Parameters

None

Return Value

0

success

other

failure

MTK_GetVulcanEnvironmentVariable

int MTK_GetVulcanEnvironmentVariable(const char* vulcan);
		

Description

Sets the value of the environment variable 'VULCAN' for this process.

Parameters

vulcan

value to set environment variable to (char*)

Return Value

0

success

other

failure

MTK_API_Init

int MTK_API_Init(const char* licenseName);
		

Description

Initialises the API. MTK_API_SetCertificate must be run first; otherwise this will fail. This must be run before any API function other than  MTK_API_SetCertificate .

Parameters

licenseName

filename of the license

Return Value

0

success

other

failure

MTK_API_Terminate

void MTK_API_Terminate();
		

Description

Terminates the API. Must be called before program exit.

Parameters

None

Return Value

None

MTK_API_GetError

void MTK_API_GetError(char* error);
		

Description

Get current error string.

Parameters

error

buffer of length MTK_BUFFER_SIZE to receive the error message (char*)

Return Value

None

MTK_API_HasError

int MTK_API_HasError();
		

Description

Check if blockmodel is working correctly (or if an error has been returned from another action).

Parameters

None

Return Value

1

error

0

no error

MTK_API_IsTagAuthorised

int MTK_API_IsTagAuthorised(const char* tag);
		

Description

Checks if a tag is authorised.

Parameters

tag

the name of the tag to check (char*)

Return Value

1

it is authorised

0

it is not authorised

-1

failed

MTK_API_SetCertificate

void MTK_API_SetCertificate(const char* certificateName);
		

Description

Sets the certificate name that will be checked. Note: If you are using certificate authorisation MTK_API_SetCertificate  must be called before   MTK_API_Init .

Parameters

certificateName

filename of the certificate

Return Value

None

MTK_API_StartLogging

void MTK_API_StartLogging(const char* filename);
		

Description

Turn logging on. Does nothing if logging is already on.

Parameters

filename

the name of the logfile

Return Value

None

MTK_API_FinishLogging

void MTK_API_FinishLogging();
		

Description

Dumps stats to the logfile, then stops logging. Does nothing if logging is already off.

Parameters

None

Return Value

None