Basic Functions

Functions for managing API initialisation, licensing, configuration, error handling, authorization, and logging.

MTK_API_InitExtend()

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.

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

Signature
int MTK_API_InitExtend();
Parameters (None)
Returns

0 on success; any other value indicates failure.

MTK_API_Init()

Initialises the API. MTK_API_SetCertificate() must be called first; otherwise this will fail. These two functions must be called before any other API function.

Signature
int MTK_API_Init(const char* licenseName);
Parameters

licenseName: Filename of the license.

Returns

0 on success; any other value indicates failure.

MTK_API_Terminate()

Terminates the API. Must be called before program exit.

Signature
void MTK_API_Terminate();
Parameters (None)
Returns

(None)

MTK_API_GetError()

Get current error string.

Signature
void MTK_API_GetError(char* error);
Parameters

error: buffer of length MTK_BUFFER_SIZE to receive the error message.

Returns

(None)

MTK_API_HasError()

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

Signature
int MTK_API_HasError();
Parameters

(None)

Returns
  • 1: Error

  • 0: No error

MTK_API_IsTagAuthorised()

Checks if a tag is authorised.

Signature
int MTK_API_IsTagAuthorised(const char* tag);
Parameters

tag: The name of the tag to check.

Returns
  • 1: Tag is authorised

  • 0: Tag is not authorised

  • -1: Failed

MTK_API_SetCertificate()

Sets the certificate name that will be checked.

Note:   If you are using certificate authorisation, this function must be called before   MTK_API_Init().

Signature
void MTK_API_SetCertificate(const char* certificateName);
Parameters

certificateName: The filename of the certificate.

Returns

(None)

MTK_API_StartLogging()

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

Signature
void MTK_API_StartLogging(const char* filename);
Parameters

filename: The name of the log file.

Returns

(None)

MTK_API_FinishLogging()

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

Signature
void MTK_API_FinishLogging();
Parameters

(None)

Returns

(None)

MTK_GetVulcanEnvironmentVariable()

Gets the value of the environment variable VULCAN for this process.

Signature
int MTK_GetVulcanEnvironmentVariable(char* vulcan);
Parameters

vulcan: The current value of the VULCAN environment variable.

Returns

0 on success; any other value indicates failure.

MTK_SetVulcanEnvironmentVariable()

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

Note:  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.

Signature
int MTK_SetVulcanEnvironmentVariable(const char* vulcan);
Parameters

vulcan: The value to set the environment variable to.

Returns

0 on success; any other value indicates failure.