Simple Virtual Machine A simple but flexible virtual machine

Loading...
Searching...
No Matches
Functions
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.
SVM_FUNCTION SVM_Structure | svm_structure_new_null (const void *svm, const SVM_Value_PluginEntryPoint type)
| This function creates a new null structure handler.
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.
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.
SVM_FUNCTION SVM_Structure | svm_structure_copy (const void *svm, const SVM_Structure structure)
| This function copies a structure.

## 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] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | structure | The structure to be copied.

Returns
  The copied structure.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  FAILURE | interruption 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] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | type | The expected type name of the structure.
  [in] | structure | The structure to be diagnosed.

Returns
  The raw pointer contained by the structure.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  FAILURE | interruption 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] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | structure | The structure to be diagnosed.

Returns
  The type name of the structure.

Exceptions

  FAILURE | interruption 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] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | type | The structure type name.
  [in] | value | The structure raw pointer.

Returns
  The structure handler containing the raw pointer.

Exceptions

  FAILURE | interruption 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] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | type | The structure type name.

Returns
  The structure handler without value.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)