Simple Virtual Machine
A simple but flexible virtual machine
SVM structures

This module contains API functions to handle SVM structures. More...

Functions

SVM_FUNCTION SVM_Structure svm_structure_new (const void *svm, const SVM_Value_PluginEntryPoint type, void *value)
 This function creates a new structure handler to convey a raw structure pointer. More...
 
SVM_FUNCTION SVM_Structure svm_structure_new_null (const void *svm, const SVM_Value_PluginEntryPoint type)
 This function creates a new null structure handler. More...
 
SVM_FUNCTION SVM_Value_PluginEntryPoint svm_structure_get_type (const void *svm, const SVM_Structure structure)
 This function retrieves the type name of a structure. More...
 
SVM_FUNCTION void * svm_structure_get_internal (const void *svm, const SVM_Value_PluginEntryPoint type, const SVM_Structure structure)
 This function retrieves the raw pointer of a structure. More...
 
SVM_FUNCTION SVM_Structure svm_structure_copy (const void *svm, const SVM_Structure structure)
 This function copies a structure. More...
 

Detailed Description

This module contains API functions to handle SVM structures.

Structures are special values used solely in plugin callback functions.

Their behavior is similar to plugin defined types, and can be used as plugin function parameters

See also
SVM functions
SVM structure parameters

Function Documentation

◆ svm_structure_copy()

SVM_FUNCTION SVM_Structure svm_structure_copy ( const void *  svm,
const SVM_Structure  structure 
)

This function copies a structure.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]structureThe structure to be copied.
Returns
The copied structure.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption when the structure type does not support the copy operation.

◆ svm_structure_get_internal()

SVM_FUNCTION void * svm_structure_get_internal ( const void *  svm,
const SVM_Value_PluginEntryPoint  type,
const SVM_Structure  structure 
)

This function retrieves the raw pointer of a structure.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]typeThe expected type name of the structure.
[in]structureThe structure to be diagnosed.
Returns
The raw pointer contained by the structure.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption when the structure type name mismatches the expected one.
See also
svm_value_pluginentrypoint_new__raw

◆ svm_structure_get_type()

SVM_FUNCTION SVM_Value_PluginEntryPoint svm_structure_get_type ( const void *  svm,
const SVM_Structure  structure 
)

This function retrieves the type name of a structure.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]structureThe structure to be diagnosed.
Returns
The type name of the structure.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)

◆ svm_structure_new()

SVM_FUNCTION SVM_Structure svm_structure_new ( const void *  svm,
const SVM_Value_PluginEntryPoint  type,
void *  value 
)

This function creates a new structure handler to convey a raw structure pointer.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]typeThe structure type name.
[in]valueThe structure raw pointer.
Returns
The structure handler containing the raw pointer.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)

◆ svm_structure_new_null()

SVM_FUNCTION SVM_Structure svm_structure_new_null ( const void *  svm,
const SVM_Value_PluginEntryPoint  type 
)

This function creates a new null structure handler.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]typeThe structure type name.
Returns
The structure handler without value.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)