1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//===----------------------------------------------------------------------===//
// Copyright (c) 2026, Modular Inc. All rights reserved.
//
// Licensed under the Apache License v2.0 with LLVM Exceptions:
// https://llvm.org/LICENSE.txt
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//===----------------------------------------------------------------------===//
/// Gets the MAX Engine version.
///
/// @returns A string containing the semantic version of the MAX Engine.
MODULAR_API_EXPORT const char *;
/// 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:
///
/// ```c
/// 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()`.
MODULAR_API_EXPORT M_Status *;
/// Gets an error message from the `M_Status` parameter.
///
/// You should call this only if `M_isError()` is true.
///
/// @param status The status object for reporting errors and other messages.
/// @returns A pointer to a null-terminated string containing the error
/// message.
MODULAR_API_EXPORT const char *;
/// Checks if status holds an error value.
///
/// @param status The status object for reporting errors and other messages.
/// @returns `0` if there is no error, `1` otherwise.
MODULAR_API_EXPORT int ;
/// Deallocates the memory for the status object. No-op if `status` is `NULL`.
///
/// @param status The status object for reporting errors and other messages.
MODULAR_API_EXPORT void ;
// MAX_C_COMMON_H