Common
#include "max/c/common.h"Functions:
M_version()
const char *M_version()
Gets the MAX Engine version.
-
Returns:
A string containing the semantic version of the MAX Engine.
M_newStatus()
M_Status *M_newStatus()
Creates a new status object.
This is required as an argument for several functions, such as M_newRuntimeContext() and M_compileModel(). They will update the status object and you can check for errors with M_isError() and get the status message with M_getError(). For example:
M_Status *status = M_newStatus();
M_RuntimeConfig *runtimeConfig = M_newRuntimeConfig();
M_RuntimeContext *context = M_newRuntimeContext(runtimeConfig, status);
if (M_isError(status)) {
logError(M_getError(status));
return EXIT_FAILURE;
}-
Returns:
A pointer to the new status object. You are responsible for the memory associated with the pointer returned. You can deallocate the memory by calling
M_freeStatus().
M_getError()
const char *M_getError(const M_Status *status)
Gets an error message from the M_Status parameter.
You should call this only if M_isError() is true.
-
Parameters:
status – The status object for reporting errors and other messages.
-
Returns:
A pointer to a null-terminated string containing the error message.
M_isError()
int M_isError(const M_Status *status)
Checks if status holds an error value.
-
Parameters:
status – The status object for reporting errors and other messages.
-
Returns:
0if there is no error,1otherwise.
M_freeStatus()
void M_freeStatus(M_Status *status)
Deallocates the memory for the status object. No-op if status is NULL.
-
Parameters:
status – The status object for reporting errors and other messages.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!